- java.lang.Object
-
- org.hibernate.type.descriptor.converter.internal.OrdinalEnumValueConverter<E,N>
-
- All Implemented Interfaces:
Serializable
,BasicValueConverter<E,N>
,EnumValueConverter<E,N>
public class OrdinalEnumValueConverter<E extends Enum<E>,N extends Number> extends Object implements EnumValueConverter<E,N>, Serializable
BasicValueConverter handling the conversion of an enum based on JPAEnumType.ORDINAL
strategy (storing the ordinal)- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description OrdinalEnumValueConverter(EnumJavaType<E> enumJavaType, JdbcType jdbcType, JavaType<N> relationalJavaType)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getCheckCondition(String columnName, JdbcType jdbcType, Dialect dialect)
The check constraint that should be added to the column definition in generated DDL.EnumJavaType<E>
getDomainJavaType()
Descriptor for the Java type for the domain portion of this converterint
getJdbcTypeCode()
JavaType<N>
getRelationalJavaType()
Descriptor for the Java type for the relational portion of this converterE
toDomainValue(Number relationalForm)
Convert the relational form just retrieved from JDBC ResultSet into the domain form.N
toRelationalValue(E domainForm)
Convert the domain form into the relational form in preparation for storage into JDBCString
toSqlLiteral(Object value)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.hibernate.type.descriptor.converter.spi.BasicValueConverter
getSpecializedTypeDeclaration
-
-
-
-
Constructor Detail
-
OrdinalEnumValueConverter
public OrdinalEnumValueConverter(EnumJavaType<E> enumJavaType, JdbcType jdbcType, JavaType<N> relationalJavaType)
-
-
Method Detail
-
toDomainValue
public E toDomainValue(Number relationalForm)
Description copied from interface:BasicValueConverter
Convert the relational form just retrieved from JDBC ResultSet into the domain form.- Specified by:
toDomainValue
in interfaceBasicValueConverter<E extends Enum<E>,N extends Number>
-
toRelationalValue
public N toRelationalValue(E domainForm)
Description copied from interface:BasicValueConverter
Convert the domain form into the relational form in preparation for storage into JDBC- Specified by:
toRelationalValue
in interfaceBasicValueConverter<E extends Enum<E>,N extends Number>
-
getJdbcTypeCode
public int getJdbcTypeCode()
- Specified by:
getJdbcTypeCode
in interfaceEnumValueConverter<E extends Enum<E>,N extends Number>
-
getDomainJavaType
public EnumJavaType<E> getDomainJavaType()
Description copied from interface:BasicValueConverter
Descriptor for the Java type for the domain portion of this converter- Specified by:
getDomainJavaType
in interfaceBasicValueConverter<E extends Enum<E>,N extends Number>
- Specified by:
getDomainJavaType
in interfaceEnumValueConverter<E extends Enum<E>,N extends Number>
-
getRelationalJavaType
public JavaType<N> getRelationalJavaType()
Description copied from interface:BasicValueConverter
Descriptor for the Java type for the relational portion of this converter- Specified by:
getRelationalJavaType
in interfaceBasicValueConverter<E extends Enum<E>,N extends Number>
-
toSqlLiteral
public String toSqlLiteral(Object value)
- Specified by:
toSqlLiteral
in interfaceEnumValueConverter<E extends Enum<E>,N extends Number>
-
getCheckCondition
public String getCheckCondition(String columnName, JdbcType jdbcType, Dialect dialect)
Description copied from interface:BasicValueConverter
The check constraint that should be added to the column definition in generated DDL.- Specified by:
getCheckCondition
in interfaceBasicValueConverter<E extends Enum<E>,N extends Number>
- Parameters:
columnName
- the name of the columnjdbcType
- theJdbcType
of the mapped columndialect
- the SQLDialect
- Returns:
- a check constraint condition or null
-
-