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
-
Constructor Summary
-
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 DatabaseMapping
INTERNAL: Return the mapping.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.
-
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:
convertDataValueToObjectValue
in interfaceConverter
- Specified by:
convertDataValueToObjectValue
in interfaceCoreConverter<DatabaseMapping,
Session>
-
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.
-