Module org.eclipse.persistence.core
Class TypeConversionConverter
java.lang.Object
org.eclipse.persistence.mappings.converters.TypeConversionConverter
- All Implemented Interfaces:
Serializable
,CoreConverter<DatabaseMapping,
,Session> ClassNameConversionRequired
,Converter
public class TypeConversionConverter
extends Object
implements Converter, ClassNameConversionRequired
Purpose: Type conversion converters are used to explicitly map a database type to a
Java type.
- Since:
- OracleAS TopLink 10g (10.0.3)
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Class
<?> Field typeprotected String
protected DatabaseMapping
protected Class
<?> Object typeprotected String
-
Constructor Summary
ConstructorsConstructorDescriptionPUBLIC: Default constructor.TypeConversionConverter
(DatabaseMapping mapping) PUBLIC: Default constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
convertClassNamesToClasses
(ClassLoader classLoader) INTERNAL: Convert all the class-name-based settings in this converter to actual class-based settings.convertDataValueToObjectValue
(Object fieldValue, Session session) INTERNAL: The field value must first be converted to the field type, then the attribute type.convertObjectValueToDataValue
(Object attributeValue, Session session) INTERNAL: Convert to the field class.Class
<?> PUBLIC: Returns the class type of the data value.INTERNAL: Return the name of the data type for the MW usage.protected DatabaseMapping
INTERNAL: Return the mapping.Class
<?> PUBLIC: Returns the class type of the object value.INTERNAL: Return the name of the object type for the MW usage.void
initialize
(DatabaseMapping mapping, Session session) INTERNAL: Set the mapping.boolean
INTERNAL: If the converter converts the value to a non-atomic value, i.e.void
setDataClass
(Class<?> dataClass) PUBLIC: Set the class type of the data value.void
setDataClassName
(String dataClassName) INTERNAL: Set the name of the data type for the MW usage.void
setObjectClass
(Class<?> objectClass) PUBLIC: Set the class type of the object value.void
setObjectClassName
(String objectClassName) INTERNAL: Set the name of the object type for the MW usage.
-
Field Details
-
mapping
-
dataClass
Field type -
dataClassName
-
objectClass
Object type -
objectClassName
-
-
Constructor Details
-
TypeConversionConverter
public TypeConversionConverter()PUBLIC: Default constructor. -
TypeConversionConverter
PUBLIC: Default constructor.
-
-
Method Details
-
convertClassNamesToClasses
INTERNAL: Convert all the class-name-based settings in this converter to actual class-based settings. This method is used when converting a project that has been built with class names to a project with classes. This method is implemented by subclasses as necessary.- Specified by:
convertClassNamesToClasses
in interfaceClassNameConversionRequired
-
convertDataValueToObjectValue
INTERNAL: The field value must first be converted to the field type, then the attribute type.- Specified by:
convertDataValueToObjectValue
in interfaceConverter
- Specified by:
convertDataValueToObjectValue
in interfaceCoreConverter<DatabaseMapping,
Session>
-
getObjectClass
PUBLIC: Returns the class type of the object value. -
getObjectClassName
INTERNAL: Return the name of the object type for the MW usage. -
getDataClass
PUBLIC: Returns the class type of the data value. -
getDataClassName
INTERNAL: Return the name of the data type for the MW usage. -
setDataClass
PUBLIC: Set the class type of the data value. -
setDataClassName
INTERNAL: Set the name of the data type for the MW usage. -
setObjectClass
PUBLIC: Set the class type of the object value. -
setObjectClassName
INTERNAL: Set the name of the object type for the MW usage. -
convertObjectValueToDataValue
INTERNAL: Convert to the field class.- Specified by:
convertObjectValueToDataValue
in interfaceConverter
- Specified by:
convertObjectValueToDataValue
in interfaceCoreConverter<DatabaseMapping,
Session>
-
initialize
INTERNAL: Set the mapping.- Specified by:
initialize
in interfaceConverter
- Specified by:
initialize
in interfaceCoreConverter<DatabaseMapping,
Session>
-
getMapping
INTERNAL: Return the mapping. -
isMutable
public boolean isMutable()INTERNAL: If the converter converts the value to a non-atomic value, i.e. a value that can have its' parts changed without being replaced, then it must return false, serialization can be non-atomic.
-