Class NamedEnumValueConverter<E extends Enum<E>>
- java.lang.Object
-
- org.hibernate.type.descriptor.converter.internal.NamedEnumValueConverter<E>
-
- All Implemented Interfaces:
Serializable
,BasicValueConverter<E,Object>
,EnumValueConverter<E,Object>
public class NamedEnumValueConverter<E extends Enum<E>> extends Object implements EnumValueConverter<E,Object>, Serializable
BasicValueConverter handling the conversion of an enum based on JPAEnumType.STRING
strategy (storing the name)- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description NamedEnumValueConverter(EnumJavaType<E> domainTypeDescriptor, JdbcType jdbcType, JavaType<?> relationalTypeDescriptor)
-
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<Object>
getRelationalJavaType()
Descriptor for the Java type for the relational portion of this converterString
getSpecializedTypeDeclaration(JdbcType jdbcType, Dialect dialect)
E
toDomainValue(Object relationalForm)
Convert the relational form just retrieved from JDBC ResultSet into the domain form.Object
toRelationalValue(E domainForm)
Convert the domain form into the relational form in preparation for storage into JDBCString
toSqlLiteral(Object value)
-
-
-
Constructor Detail
-
NamedEnumValueConverter
public NamedEnumValueConverter(EnumJavaType<E> domainTypeDescriptor, JdbcType jdbcType, JavaType<?> relationalTypeDescriptor)
-
-
Method Detail
-
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>,Object>
- Specified by:
getDomainJavaType
in interfaceEnumValueConverter<E extends Enum<E>,Object>
-
getRelationalJavaType
public JavaType<Object> 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>,Object>
-
toDomainValue
public E toDomainValue(Object 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>,Object>
-
toRelationalValue
public Object 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>,Object>
-
getJdbcTypeCode
public int getJdbcTypeCode()
- Specified by:
getJdbcTypeCode
in interfaceEnumValueConverter<E extends Enum<E>,Object>
-
toSqlLiteral
public String toSqlLiteral(Object value)
- Specified by:
toSqlLiteral
in interfaceEnumValueConverter<E extends Enum<E>,Object>
-
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>,Object>
- Parameters:
columnName
- the name of the columnjdbcType
- theJdbcType
of the mapped columndialect
- the SQLDialect
- Returns:
- a check constraint condition or null
-
getSpecializedTypeDeclaration
public String getSpecializedTypeDeclaration(JdbcType jdbcType, Dialect dialect)
- Specified by:
getSpecializedTypeDeclaration
in interfaceBasicValueConverter<E extends Enum<E>,Object>
-
-