Package org.openxava.types
Class EnumStringType
java.lang.Object
org.openxava.types.EnumStringType
- All Implemented Interfaces:
org.hibernate.usertype.ParameterizedType,org.hibernate.usertype.UserType
public class EnumStringType
extends Object
implements org.hibernate.usertype.UserType, org.hibernate.usertype.ParameterizedType
In java an Enum and in database a String corresponding
to the position in the string that it's in property 'strings'.
Example of use:
- Author:
- David Buedo
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionassemble(Serializable cached, Object owner) disassemble(Object obj) booleanFull qualified class for the Enum.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.voidsetParameterValues(Properties parameters) voidsetStrings(String strings) String that corresponds with the valid values for this enum.int[]sqlTypes()
-
Constructor Details
-
EnumStringType
public EnumStringType()
-
-
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. <p> For example: "model.EntityName$EnumName" -
setEnumType
Full qualified class for the Enum. <p> For example: "model.EntityName$EnumName" -
getStrings
String that corresponds with the valid values for this enum. <p> For example, "ALTA,MEDIA,BAJA", means: <ul> <li> ordinal 0 in Java Enum for 'ALTA' in DB <li> ordinal 1 in Java Enum for 'MEDIA' in DB <li> ordinal 2 in Java Enum for 'BAJA' in DB <li> </ul> -
setStrings
String that corresponds with the valid values for this enum. <p> For example, "ALTA,MEDIA,BAJA", means: <ul> <li> ordinal 0 in Java Enum for 'ALTA' in DB <li> ordinal 1 in Java Enum for 'MEDIA' in DB <li> ordinal 2 in Java Enum for 'BAJA' in DB <li> </ul>
-