Interface Converter

All Superinterfaces:
CoreConverter<DatabaseMapping,Session>, Serializable
All Known Subinterfaces:
XMLConverter
All Known Implementing Classes:
ClassInstanceConverter, ConverterClass, EnumTypeConverter, InstanceClassConverter, JAXBEnumTypeConverter, JAXBTypesafeEnumConverter, ObjectTypeConverter, SerializedObjectConverter, TypeConversionConverter, TypeStringConverter, XMLConverterAdapter, XMLListConverter, XMLRootConverter

public interface Converter extends CoreConverter<DatabaseMapping,Session>, Serializable

Purpose: Conversion interface to allow conversion between object and data types. This can be used in any mapping to convert between the object and data types without requiring code placed in the object model. TopLink provides several common converters, but the application can also define it own.

See Also:
Author:
James Sutherland
  • Method Details

    • convertObjectValueToDataValue

      Object convertObjectValueToDataValue(Object objectValue, Session session)
      PUBLIC: Convert the object's representation of the value to the databases' data representation. For example this could convert between a Calendar Java type and the sql.Time datatype.
      Specified by:
      convertObjectValueToDataValue in interface CoreConverter<DatabaseMapping,Session>
    • convertDataValueToObjectValue

      Object convertDataValueToObjectValue(Object dataValue, Session session)
      PUBLIC: Convert the databases' data representation of the value to the object's representation. For example this could convert between an sql.Time datatype and the Java Calendar type.
      Specified by:
      convertDataValueToObjectValue in interface CoreConverter<DatabaseMapping,Session>
    • isMutable

      boolean isMutable()
      PUBLIC: If the converter converts the value to a mutable value, i.e. a value that can have its' parts changed without being replaced, then it must return true. If the value is not mutable, cannot be changed without replacing the whole value then false must be returned. This is used within the UnitOfWork to determine how to clone.
    • initialize

      void initialize(DatabaseMapping mapping, Session session)
      PUBLIC: Allow for any initialization.
      Specified by:
      initialize in interface CoreConverter<DatabaseMapping,Session>