Top Description Methods
org.eclipse.persistence.mappings.converters

public Interface Converter

extends CoreConverter<DatabaseMapping, Session>, Serializable
Known Direct Subinterfaces
org.eclipse.persistence.oxm.mappings.converters.XMLConverter
Known Direct Implementers
org.eclipse.persistence.mappings.converters.ConverterClass, org.eclipse.persistence.mappings.converters.ObjectTypeConverter, org.eclipse.persistence.mappings.converters.SerializedObjectConverter, org.eclipse.persistence.mappings.converters.TypeConversionConverter, org.eclipse.persistence.mappings.converters.UUIDConverter, org.eclipse.persistence.oxm.mappings.converters.XMLListConverter, org.eclipse.persistence.mappings.converters.ClassInstanceConverter
Imports
java.io.Serializable, org.eclipse.persistence.core.mappings.converters.CoreConverter, org.eclipse.persistence.mappings.*, org.eclipse.persistence.sessions.Session

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.

Author
James Sutherland
Since
OracleAS TopLink 10g (10.0.3)
See Also
DirectToFieldMapping#setConverter(Converter), DirectCollectionMapping#setValueConverter(Converter), ObjectTypeConverter, TypeConversionConverter

Method Summary

Modifier and TypeMethod and Description
public Object
convertDataValueToObjectValue(Object dataValue, Session session)

Redeclares org.eclipse.persistence.core.mappings.converters.CoreConverter.convertDataValueToObjectValue.

PUBLIC: Convert the databases' data representation of the value to the object's representation.
public Object
convertObjectValueToDataValue(Object objectValue, Session session)

Redeclares org.eclipse.persistence.core.mappings.converters.CoreConverter.convertObjectValueToDataValue.

PUBLIC: Convert the object's representation of the value to the databases' data representation.
public void
initialize(DatabaseMapping mapping, Session session)

Redeclares org.eclipse.persistence.core.mappings.converters.CoreConverter.initialize.

PUBLIC: Allow for any initialization.
public 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.

Method Detail

convertDataValueToObjectValueback to summary
public Object convertDataValueToObjectValue(Object dataValue, Session session)

Redeclares org.eclipse.persistence.core.mappings.converters.CoreConverter.convertDataValueToObjectValue.

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.

Annotations
@Override
convertObjectValueToDataValueback to summary
public Object convertObjectValueToDataValue(Object objectValue, Session session)

Redeclares org.eclipse.persistence.core.mappings.converters.CoreConverter.convertObjectValueToDataValue.

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.

Annotations
@Override
initializeback to summary
public void initialize(DatabaseMapping mapping, Session session)

Redeclares org.eclipse.persistence.core.mappings.converters.CoreConverter.initialize.

PUBLIC: Allow for any initialization.

Annotations
@Override
isMutableback to summary
public 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.