Class ClassInstanceConverter
- java.lang.Object
-
- org.eclipse.persistence.mappings.converters.ClassInstanceConverter
-
- All Implemented Interfaces:
java.io.Serializable,CoreConverter<DatabaseMapping,Session>,Converter
public class ClassInstanceConverter extends java.lang.Object implements Converter
Purpose: Allows a class name to be converted to and from a new instance of the class. When using a ClassInstanceConverter, the database will store the Class name and the java object model will contain an instance of that class initialized with its default constructor- See Also:
- Serialized Form
- Author:
- James Sutherland
- Since:
- OracleAS TopLink 10g (10.0.3)
-
-
Field Summary
Fields Modifier and Type Field Description protected DatabaseMappingmapping
-
Constructor Summary
Constructors Constructor Description ClassInstanceConverter()PUBLIC: Default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.ObjectconvertDataValueToObjectValue(java.lang.Object fieldValue, Session session)INTERNAL: Convert the class name to a class, then create an instance of the class.java.lang.ObjectconvertObjectValueToDataValue(java.lang.Object attributeValue, Session session)INTERNAL: Convert to the field class.protected DatabaseMappinggetMapping()INTERNAL: Return the mapping.voidinitialize(DatabaseMapping mapping, Session session)INTERNAL: Set the mapping.booleanisMutable()INTERNAL: If the converter converts the value to a non-atomic value, i.e.
-
-
-
Field Detail
-
mapping
protected DatabaseMapping mapping
-
-
Method Detail
-
convertDataValueToObjectValue
public java.lang.Object convertDataValueToObjectValue(java.lang.Object fieldValue, Session session)INTERNAL: Convert the class name to a class, then create an instance of the class.- Specified by:
convertDataValueToObjectValuein interfaceConverter- Specified by:
convertDataValueToObjectValuein interfaceCoreConverter<DatabaseMapping,Session>
-
convertObjectValueToDataValue
public java.lang.Object convertObjectValueToDataValue(java.lang.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.
-
-