|
EclipseLink 2.0.0, build 'v20091127-r5931' API Reference | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.persistence.mappings.converters.ObjectTypeConverter
org.eclipse.persistence.mappings.converters.EnumTypeConverter
public class EnumTypeConverter
Purpose: Object type converter is used to match a fixed number of database data values to a Java enum object value. It can be used when the values on the database and in the Java differ. To create an object type converter, simply specify the set of conversion value pairs. A default value and one-way conversion are also supported for legacy data situations.
Field Summary |
---|
Fields inherited from class org.eclipse.persistence.mappings.converters.ObjectTypeConverter |
---|
attributeToFieldValues, defaultAttributeValue, fieldClassification, fieldClassificationName, fieldToAttributeValues, mapping |
Constructor Summary | |
---|---|
EnumTypeConverter(DatabaseMapping mapping,
java.lang.Class enumClass,
boolean useOrdinalValues)
PUBLIC: Creating an enum converter this way will create the conversion values for you using ordinal or name values. |
|
EnumTypeConverter(DatabaseMapping mapping,
java.lang.String enumClassName)
PUBLIC: Creating an enum converter this way expects that you will provide the conversion values separately. |
Method Summary | |
---|---|
void |
convertClassNamesToClasses(java.lang.ClassLoader classLoader)
INTERNAL: Convert all the class-name-based settings in this converter to actual class-based settings. |
java.lang.Object |
convertDataValueToObjectValue(java.lang.Object fieldValue,
Session session)
INTERNAL: Returns the corresponding attribute value for the specified field value. |
java.lang.Object |
convertObjectValueToDataValue(java.lang.Object attributeValue,
Session session)
INTERNAL: Convert Enum object to the data value. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public EnumTypeConverter(DatabaseMapping mapping, java.lang.Class enumClass, boolean useOrdinalValues)
public EnumTypeConverter(DatabaseMapping mapping, java.lang.String enumClassName)
Method Detail |
---|
public void convertClassNamesToClasses(java.lang.ClassLoader classLoader)
convertClassNamesToClasses
in class ObjectTypeConverter
classLoader
- public java.lang.Object convertDataValueToObjectValue(java.lang.Object fieldValue, Session session)
convertDataValueToObjectValue
in interface Converter
convertDataValueToObjectValue
in class ObjectTypeConverter
public java.lang.Object convertObjectValueToDataValue(java.lang.Object attributeValue, Session session)
convertObjectValueToDataValue
in interface Converter
convertObjectValueToDataValue
in class ObjectTypeConverter
|
EclipseLink 2.0.0, build 'v20091127-r5931' API Reference | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |