public class EnumOrdinalType extends Object implements Convertible<Enum<?>,Integer>
@Converter(converter = TimeUnit.class, isEnum = EnumType.STRING)For save then ordinal value of Enumeration.
@Converter(converter = TimeUnit.class, isEnum = EnumType.ORDINAL)If any value is used for
isEnum
the EnumType.STRING
is used per default.
@Converter(converter = TimeUnit.class)
Constructor and Description |
---|
EnumOrdinalType(Class<?> enumType) |
Modifier and Type | Method and Description |
---|---|
ColumnType |
getColumnType() |
Class |
getType() |
Enum<?> |
toAttribute(Integer jdbc)
Convert the jdbc value to attribute format or type
|
Integer |
toJdbc(Enum<?> attribute)
Convert attribute to jdbc format or type
|
String |
toString() |
public EnumOrdinalType(Class<?> enumType)
public Integer toJdbc(Enum<?> attribute)
Convertible
toJdbc
in interface Convertible<Enum<?>,Integer>
attribute
- the value of to be convertedpublic Enum<?> toAttribute(Integer jdbc)
Convertible
toAttribute
in interface Convertible<Enum<?>,Integer>
jdbc
- the value stored at databasepublic ColumnType getColumnType()
getColumnType
in interface Convertible<Enum<?>,Integer>
Copyright © 2012–2020 jkniv, copyleft code. All rights reserved.