Package org.openxava.types
Class EnumLetterType
java.lang.Object
org.openxava.types.EnumLetterType
- All Implemented Interfaces:
org.hibernate.usertype.ParameterizedType,org.hibernate.usertype.UserType<Enum>
public class EnumLetterType
extends Object
implements org.hibernate.usertype.UserType<Enum>, org.hibernate.usertype.ParameterizedType
In java an Enum and in database a letter corresponding
to the position in the string that it's in property 'letters'.
- Since:
- 8.0
- Author:
- Javier Paniza
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionassemble(Serializable cached, Object owner) disassemble(Enum value) booleanFull qualified class for the Enum.Letters string that corresponds with the valid values for this enum.intintbooleannullSafeGet(ResultSet rs, int position, org.hibernate.type.descriptor.WrapperOptions options) voidnullSafeSet(PreparedStatement st, Enum value, int index, org.hibernate.type.descriptor.WrapperOptions options) voidsetEnumType(String enumType) Full qualified class for the Enum.voidsetLetters(String letters) Letters string that corresponds with the valid values for this enum.voidsetParameterValues(Properties parameters) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.hibernate.usertype.UserType
getDefaultSqlLength, getDefaultSqlLength, getDefaultSqlPrecision, getDefaultSqlPrecision, getDefaultSqlScale, getDefaultSqlScale, getValueConverter, isComparable, nullSafeGet, nullSafeSet
-
Constructor Details
-
EnumLetterType
public EnumLetterType()
-
-
Method Details
-
getSqlType
public int getSqlType()- Specified by:
getSqlTypein interfaceorg.hibernate.usertype.UserType<Enum>
-
returnedClass
- Specified by:
returnedClassin interfaceorg.hibernate.usertype.UserType<Enum>
-
equals
- Specified by:
equalsin interfaceorg.hibernate.usertype.UserType<Enum>
-
hashCode
- Specified by:
hashCodein interfaceorg.hibernate.usertype.UserType<Enum>
-
nullSafeGet
public Enum nullSafeGet(ResultSet rs, int position, org.hibernate.type.descriptor.WrapperOptions options) throws SQLException - Specified by:
nullSafeGetin interfaceorg.hibernate.usertype.UserType<Enum>- Throws:
SQLException
-
nullSafeSet
public void nullSafeSet(PreparedStatement st, Enum value, int index, org.hibernate.type.descriptor.WrapperOptions options) throws SQLException - Specified by:
nullSafeSetin interfaceorg.hibernate.usertype.UserType<Enum>- Throws:
SQLException
-
setParameterValues
- Specified by:
setParameterValuesin interfaceorg.hibernate.usertype.ParameterizedType
-
deepCopy
- Specified by:
deepCopyin interfaceorg.hibernate.usertype.UserType<Enum>
-
isMutable
public boolean isMutable()- Specified by:
isMutablein interfaceorg.hibernate.usertype.UserType<Enum>
-
disassemble
- Specified by:
disassemblein interfaceorg.hibernate.usertype.UserType<Enum>
-
assemble
- Specified by:
assemblein interfaceorg.hibernate.usertype.UserType<Enum>
-
replace
- Specified by:
replacein interfaceorg.hibernate.usertype.UserType<Enum>
-
getEnumType
Full qualified class for the Enum.For example: "org.openxava.test.model.Delivery$Distance"
-
setEnumType
Full qualified class for the Enum.For example: "org.openxava.test.model.Delivery$Distance"
-
getLetters
Letters string that corresponds with the valid values for this enum.For example, "AEI", means:
- ordinal 0 in Java Enum for 'A' in DB
- ordinal 1 in Java Enum for 'E' in DB
- ordinal 2 in Java Enum for 'I' in DB
-
setLetters
Letters string that corresponds with the valid values for this enum.For example, "AEI", means:
- ordinal 0 in Java Enum for 'A' in DB
- ordinal 1 in Java Enum for 'E' in DB
- ordinal 2 in Java Enum for 'I' in DB
-