Class EnumTypeConverter

  • All Implemented Interfaces:
    Serializable, CoreConverter<DatabaseMapping,​Session>, org.eclipse.persistence.internal.descriptors.ClassNameConversionRequired, Converter

    public class EnumTypeConverter
    extends ObjectTypeConverter
    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.
    See Also:
    Serialized Form
    Author:
    Guy Pelletier
    Since:
    Toplink 10.1.4RI
    • Constructor Detail

      • EnumTypeConverter

        public EnumTypeConverter​(DatabaseMapping mapping,
                                 Class enumClass,
                                 boolean useOrdinalValues)
        PUBLIC: Creating an enum converter this way will create the conversion values for you using ordinal or name values.
      • EnumTypeConverter

        public EnumTypeConverter​(DatabaseMapping mapping,
                                 String enumClassName,
                                 boolean useOrdinalValues)
        PUBLIC: Creating an enum converter this way will create the conversion values for you using ordinal or name values.
      • EnumTypeConverter

        public EnumTypeConverter​(DatabaseMapping mapping,
                                 String enumClassName)
        PUBLIC: Creating an enum converter this way expects that you will provide the conversion values separately.