Class ClassInstanceConverter
java.lang.Object
org.eclipse.persistence.mappings.converters.ClassInstanceConverter
- All Implemented Interfaces:
Serializable,CoreConverter<DatabaseMapping,,Session> 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:
- Author:
- James Sutherland
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionconvertDataValueToObjectValue(Object fieldValue, Session session) INTERNAL: Convert the class name to a class, then create an instance of the class.convertObjectValueToDataValue(Object attributeValue, Session session) INTERNAL: Convert to the field class.protected DatabaseMappingINTERNAL: Return the mapping.voidinitialize(DatabaseMapping mapping, Session session) INTERNAL: Set the mapping.booleanINTERNAL: If the converter converts the value to a non-atomic value, i.e.
-
Field Details
-
mapping
-
-
Constructor Details
-
ClassInstanceConverter
public ClassInstanceConverter()PUBLIC: Default constructor.
-
-
Method Details
-
convertDataValueToObjectValue
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
INTERNAL: Convert to the field class.- Specified by:
convertObjectValueToDataValuein interfaceConverter- Specified by:
convertObjectValueToDataValuein interfaceCoreConverter<DatabaseMapping,Session>
-
initialize
INTERNAL: Set the mapping.- Specified by:
initializein interfaceConverter- Specified by:
initializein 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.
-