Package org.openxava.types
Class EnumLetterType
java.lang.Object
org.openxava.types.EnumLetterType
- All Implemented Interfaces:
org.hibernate.usertype.ParameterizedType,org.hibernate.usertype.UserType
public class EnumLetterType
extends Object
implements org.hibernate.usertype.UserType, 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'.
- Author:
- Javier Paniza
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionassemble(Serializable cached, Object owner) disassemble(Object obj) booleanFull qualified class for the Enum.Letters string that corresponds with the valid values for this enum.intbooleannullSafeGet(ResultSet resultSet, String[] names, org.hibernate.engine.spi.SharedSessionContractImplementor sessionImplementor, Object owner) voidnullSafeSet(PreparedStatement ps, Object value, int index, org.hibernate.engine.spi.SharedSessionContractImplementor sessionImplementor) 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) int[]sqlTypes()
-
Constructor Details
-
EnumLetterType
public EnumLetterType()
-
-
Method Details
-
sqlTypes
public int[] sqlTypes()- Specified by:
sqlTypesin interfaceorg.hibernate.usertype.UserType
-
returnedClass
- Specified by:
returnedClassin interfaceorg.hibernate.usertype.UserType
-
equals
- Specified by:
equalsin interfaceorg.hibernate.usertype.UserType- Throws:
org.hibernate.HibernateException
-
hashCode
- Specified by:
hashCodein interfaceorg.hibernate.usertype.UserType- Throws:
org.hibernate.HibernateException
-
setParameterValues
- Specified by:
setParameterValuesin interfaceorg.hibernate.usertype.ParameterizedType
-
deepCopy
- Specified by:
deepCopyin interfaceorg.hibernate.usertype.UserType- Throws:
org.hibernate.HibernateException
-
isMutable
public boolean isMutable()- Specified by:
isMutablein interfaceorg.hibernate.usertype.UserType
-
disassemble
- Specified by:
disassemblein interfaceorg.hibernate.usertype.UserType- Throws:
org.hibernate.HibernateException
-
assemble
- Specified by:
assemblein interfaceorg.hibernate.usertype.UserType- Throws:
org.hibernate.HibernateException
-
replace
public Object replace(Object original, Object target, Object owner) throws org.hibernate.HibernateException - Specified by:
replacein interfaceorg.hibernate.usertype.UserType- Throws:
org.hibernate.HibernateException
-
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
-