public class OrdinalEnumValueConverter<E extends Enum> extends Object implements EnumValueConverter<E,Integer>, Serializable
EnumType.ORDINAL
strategy (storing the ordinal)Constructor and Description |
---|
OrdinalEnumValueConverter(EnumJavaTypeDescriptor<E> enumJavaDescriptor) |
Modifier and Type | Method and Description |
---|---|
EnumJavaTypeDescriptor<E> |
getJavaDescriptor() |
int |
getJdbcTypeCode() |
E |
readValue(ResultSet resultSet,
String name) |
E |
toDomainValue(Integer relationalForm)
Convert the relational form just retrieved from JDBC ResultSet into
the domain form.
|
Integer |
toRelationalValue(E domainForm)
Convert the domain form into the relational form in preparation for
storage into JDBC
|
String |
toSqlLiteral(Object value) |
void |
writeValue(PreparedStatement statement,
E value,
int position) |
public OrdinalEnumValueConverter(EnumJavaTypeDescriptor<E> enumJavaDescriptor)
public E toDomainValue(Integer relationalForm)
BasicValueConverter
toDomainValue
in interface BasicValueConverter<E extends Enum,Integer>
public Integer toRelationalValue(E domainForm)
BasicValueConverter
toRelationalValue
in interface BasicValueConverter<E extends Enum,Integer>
public int getJdbcTypeCode()
getJdbcTypeCode
in interface EnumValueConverter<E extends Enum,Integer>
public EnumJavaTypeDescriptor<E> getJavaDescriptor()
getJavaDescriptor
in interface EnumValueConverter<E extends Enum,Integer>
public E readValue(ResultSet resultSet, String name) throws SQLException
readValue
in interface EnumValueConverter<E extends Enum,Integer>
SQLException
public void writeValue(PreparedStatement statement, E value, int position) throws SQLException
writeValue
in interface EnumValueConverter<E extends Enum,Integer>
SQLException
public String toSqlLiteral(Object value)
toSqlLiteral
in interface EnumValueConverter<E extends Enum,Integer>
Copyright © 2018 JBoss by Red Hat. All rights reserved.