public class EnumNameType extends Object implements Convertible<Enum<?>,String>
@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 |
|---|
EnumNameType(Class<?> enumType) |
| Modifier and Type | Method and Description |
|---|---|
ColumnType |
getColumnType() |
Class |
getType() |
Enum<?> |
toAttribute(String jdbc)
Convert the jdbc value to attribute format or type
|
String |
toJdbc(Enum<?> attribute)
Convert attribute to jdbc format or type
|
String |
toString() |
public EnumNameType(Class<?> enumType)
public String toJdbc(Enum<?> attribute)
ConvertibletoJdbc in interface Convertible<Enum<?>,String>attribute - the value of to be convertedpublic Enum<?> toAttribute(String jdbc)
ConvertibletoAttribute in interface Convertible<Enum<?>,String>jdbc - the value stored at databasepublic ColumnType getColumnType()
getColumnType in interface Convertible<Enum<?>,String>Copyright © 2012–2020 jkniv, copyleft code. All rights reserved.