Class NamedEnumValueConverter<E extends Enum<E>>
- java.lang.Object
-
- org.hibernate.metamodel.model.convert.internal.NamedEnumValueConverter<E>
-
- All Implemented Interfaces:
Serializable,BasicValueConverter<E,String>,EnumValueConverter<E,String>
public class NamedEnumValueConverter<E extends Enum<E>> extends Object implements EnumValueConverter<E,String>, Serializable
BasicValueConverter handling the conversion of an enum based on JPAEnumType.STRINGstrategy (storing the name)- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description NamedEnumValueConverter(EnumJavaType<E> domainTypeDescriptor, JdbcType jdbcType, JavaType<String> relationalTypeDescriptor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetCheckCondition(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 converterintgetJdbcTypeCode()JavaType<String>getRelationalJavaType()Descriptor for the Java type for the relational portion of this converterStringgetSpecializedTypeDeclaration(JdbcType jdbcType, Dialect dialect)EtoDomainValue(String relationalForm)Convert the relational form just retrieved from JDBC ResultSet into the domain form.StringtoRelationalValue(E domainForm)Convert the domain form into the relational form in preparation for storage into JDBCStringtoSqlLiteral(Object value)
-
-
-
Constructor Detail
-
NamedEnumValueConverter
public NamedEnumValueConverter(EnumJavaType<E> domainTypeDescriptor, JdbcType jdbcType, JavaType<String> relationalTypeDescriptor)
-
-
Method Detail
-
getDomainJavaType
public EnumJavaType<E> getDomainJavaType()
Description copied from interface:BasicValueConverterDescriptor for the Java type for the domain portion of this converter- Specified by:
getDomainJavaTypein interfaceBasicValueConverter<E extends Enum<E>,String>- Specified by:
getDomainJavaTypein interfaceEnumValueConverter<E extends Enum<E>,String>
-
getRelationalJavaType
public JavaType<String> getRelationalJavaType()
Description copied from interface:BasicValueConverterDescriptor for the Java type for the relational portion of this converter- Specified by:
getRelationalJavaTypein interfaceBasicValueConverter<E extends Enum<E>,String>
-
toDomainValue
public E toDomainValue(String relationalForm)
Description copied from interface:BasicValueConverterConvert the relational form just retrieved from JDBC ResultSet into the domain form.- Specified by:
toDomainValuein interfaceBasicValueConverter<E extends Enum<E>,String>
-
toRelationalValue
public String toRelationalValue(E domainForm)
Description copied from interface:BasicValueConverterConvert the domain form into the relational form in preparation for storage into JDBC- Specified by:
toRelationalValuein interfaceBasicValueConverter<E extends Enum<E>,String>
-
getJdbcTypeCode
public int getJdbcTypeCode()
- Specified by:
getJdbcTypeCodein interfaceEnumValueConverter<E extends Enum<E>,String>
-
toSqlLiteral
public String toSqlLiteral(Object value)
- Specified by:
toSqlLiteralin interfaceEnumValueConverter<E extends Enum<E>,String>
-
getCheckCondition
public String getCheckCondition(String columnName, JdbcType jdbcType, Dialect dialect)
Description copied from interface:BasicValueConverterThe check constraint that should be added to the column definition in generated DDL.- Specified by:
getCheckConditionin interfaceBasicValueConverter<E extends Enum<E>,String>- Parameters:
columnName- the name of the columnjdbcType- theJdbcTypeof the mapped columndialect- the SQLDialect- Returns:
- a check constraint condition or null
-
getSpecializedTypeDeclaration
public String getSpecializedTypeDeclaration(JdbcType jdbcType, Dialect dialect)
- Specified by:
getSpecializedTypeDeclarationin interfaceBasicValueConverter<E extends Enum<E>,String>
-
-