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)
- Author:
- James Sutherland
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected Class<?>dataClassField typeprotected StringdataClassNameprotected DatabaseMappingmappingprotected Class<?>objectClassObject typeprotected StringobjectClassName
-
Constructor Summary
Constructors Constructor Description TypeConversionConverter()PUBLIC: Default constructor.TypeConversionConverter(DatabaseMapping mapping)PUBLIC: Default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidconvertClassNamesToClasses(ClassLoader classLoader)INTERNAL: Convert all the class-name-based settings in this converter to actual class-based settings.ObjectconvertDataValueToObjectValue(Object fieldValue, Session session)INTERNAL: The field value must first be converted to the field type, then the attribute type.ObjectconvertObjectValueToDataValue(Object attributeValue, Session session)INTERNAL: Convert to the field class.Class<?>getDataClass()PUBLIC: Returns the class type of the data value.StringgetDataClassName()INTERNAL: Return the name of the data type for the MW usage.protected DatabaseMappinggetMapping()INTERNAL: Return the mapping.Class<?>getObjectClass()PUBLIC: Returns the class type of the object value.StringgetObjectClassName()INTERNAL: Return the name of the object type for the MW usage.voidinitialize(DatabaseMapping mapping, Session session)INTERNAL: Set the mapping.booleanisMutable()INTERNAL: If the converter converts the value to a non-atomic value, i.e.voidsetDataClass(Class<?> dataClass)PUBLIC: Set the class type of the data value.voidsetDataClassName(String dataClassName)INTERNAL: Set the name of the data type for the MW usage.voidsetObjectClass(Class<?> objectClass)PUBLIC: Set the class type of the object value.voidsetObjectClassName(String objectClassName)INTERNAL: Set the name of the object type for the MW usage.
-
-
-
Field Detail
-
mapping
protected DatabaseMapping mapping
-
dataClass
protected Class<?> dataClass
Field type
-
dataClassName
protected String dataClassName
-
objectClass
protected Class<?> objectClass
Object type
-
objectClassName
protected String objectClassName
-
-
Constructor Detail
-
TypeConversionConverter
public TypeConversionConverter()
PUBLIC: Default constructor.
-
TypeConversionConverter
public TypeConversionConverter(DatabaseMapping mapping)
PUBLIC: Default constructor.
-
-
Method Detail
-
convertClassNamesToClasses
public void convertClassNamesToClasses(ClassLoader classLoader)
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:
convertClassNamesToClassesin interfaceClassNameConversionRequired
-
convertDataValueToObjectValue
public Object convertDataValueToObjectValue(Object fieldValue, Session session)
INTERNAL: The field value must first be converted to the field type, then the attribute type.- Specified by:
convertDataValueToObjectValuein interfaceConverter- Specified by:
convertDataValueToObjectValuein interfaceCoreConverter<DatabaseMapping,Session>
-
getObjectClass
public Class<?> getObjectClass()
PUBLIC: Returns the class type of the object value.
-
getObjectClassName
public String getObjectClassName()
INTERNAL: Return the name of the object type for the MW usage.
-
getDataClass
public Class<?> getDataClass()
PUBLIC: Returns the class type of the data value.
-
getDataClassName
public String getDataClassName()
INTERNAL: Return the name of the data type for the MW usage.
-
setDataClass
public void setDataClass(Class<?> dataClass)
PUBLIC: Set the class type of the data value.
-
setDataClassName
public void setDataClassName(String dataClassName)
INTERNAL: Set the name of the data type for the MW usage.
-
setObjectClass
public void setObjectClass(Class<?> objectClass)
PUBLIC: Set the class type of the object value.
-
setObjectClassName
public void setObjectClassName(String objectClassName)
INTERNAL: Set the name of the object type for the MW usage.
-
convertObjectValueToDataValue
public Object convertObjectValueToDataValue(Object attributeValue, Session session)
INTERNAL: Convert to the field class.- Specified by:
convertObjectValueToDataValuein interfaceConverter- Specified by:
convertObjectValueToDataValuein interfaceCoreConverter<DatabaseMapping,Session>
-
initialize
public void initialize(DatabaseMapping mapping, Session session)
INTERNAL: Set the mapping.- Specified by:
initializein interfaceConverter- Specified by:
initializein interfaceCoreConverter<DatabaseMapping,Session>
-
getMapping
protected DatabaseMapping getMapping()
INTERNAL: Return the mapping.
-
-