Top Description Fields Constructors Methods
org.eclipse.persistence.mappings.converters

public Class ClassInstanceConverter

extends Object
implements Converter
Class Inheritance
All Implemented Interfaces
org.eclipse.persistence.mappings.converters.Converter, java.io.Serializable, org.eclipse.persistence.core.mappings.converters.CoreConverter
Imports
java.security.AccessController, .PrivilegedActionException, org.eclipse.persistence.exceptions.ConversionException, org.eclipse.persistence.internal.helper.ClassConstants, org.eclipse.persistence.internal.security.PrivilegedAccessHelper, .PrivilegedNewInstanceFromClass, org.eclipse.persistence.mappings.DatabaseMapping, org.eclipse.persistence.mappings.foundation.AbstractDirectMapping, org.eclipse.persistence.sessions.Session

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
Author
James Sutherland
Since
OracleAS TopLink 10g (10.0.3)

Field Summary

Modifier and TypeField and Description
protected DatabaseMapping

Constructor Summary

AccessConstructor and Description
public
ClassInstanceConverter()

PUBLIC: Default constructor.

Method Summary

Modifier and TypeMethod and Description
public Object
convertDataValueToObjectValue(Object fieldValue, Session session)

Implements org.eclipse.persistence.mappings.converters.Converter.convertDataValueToObjectValue.

INTERNAL: Convert the class name to a class, then create an instance of the class.
public Object
protected DatabaseMapping
getMapping()

INTERNAL: Return the mapping.

public void
public boolean
isMutable()

Implements org.eclipse.persistence.mappings.converters.Converter.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.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

mappingback to summary
protected DatabaseMapping mapping

Constructor Detail

ClassInstanceConverterback to summary
public ClassInstanceConverter()

PUBLIC: Default constructor.

Method Detail

convertDataValueToObjectValueback to summary
public Object convertDataValueToObjectValue(Object fieldValue, Session session)

Implements org.eclipse.persistence.mappings.converters.Converter.convertDataValueToObjectValue.

INTERNAL: Convert the class name to a class, then create an instance of the class.

Annotations
@Override
convertObjectValueToDataValueback to summary
public Object convertObjectValueToDataValue(Object attributeValue, Session session)

Implements org.eclipse.persistence.mappings.converters.Converter.convertObjectValueToDataValue.

INTERNAL: Convert to the field class.

Annotations
@Override
getMappingback to summary
protected DatabaseMapping getMapping()

INTERNAL: Return the mapping.

initializeback to summary
public void initialize(DatabaseMapping mapping, Session session)

Implements org.eclipse.persistence.mappings.converters.Converter.initialize.

INTERNAL: Set the mapping.

Annotations
@Override
isMutableback to summary
public boolean isMutable()

Implements org.eclipse.persistence.mappings.converters.Converter.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.

Annotations
@Override