Package org.openxava.types
Class Base1EnumType
- java.lang.Object
-
- org.openxava.types.Base1EnumType
-
- All Implemented Interfaces:
org.hibernate.usertype.ParameterizedType
,org.hibernate.usertype.UserType
public class Base1EnumType extends java.lang.Object implements org.hibernate.usertype.UserType, org.hibernate.usertype.ParameterizedType
A Java enum that is stored in database using 1 as first value, and 0 as no value.Useful for compatibity with database created for OX2 valid-values.
- Author:
- Javier Paniza
-
-
Constructor Summary
Constructors Constructor Description Base1EnumType()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
assemble(java.io.Serializable cached, java.lang.Object owner)
java.lang.Object
deepCopy(java.lang.Object obj)
java.io.Serializable
disassemble(java.lang.Object obj)
boolean
equals(java.lang.Object obj1, java.lang.Object obj2)
int
hashCode(java.lang.Object obj)
boolean
isMutable()
java.lang.Object
nullSafeGet(java.sql.ResultSet resultSet, java.lang.String[] names, org.hibernate.engine.spi.SharedSessionContractImplementor sessionImplementor, java.lang.Object owner)
void
nullSafeSet(java.sql.PreparedStatement ps, java.lang.Object value, int index, org.hibernate.engine.spi.SharedSessionContractImplementor sessionImplementor)
java.lang.Object
replace(java.lang.Object original, java.lang.Object target, java.lang.Object owner)
java.lang.Class
returnedClass()
void
setParameterValues(java.util.Properties parameters)
int[]
sqlTypes()
-
-
-
Method Detail
-
sqlTypes
public int[] sqlTypes()
- Specified by:
sqlTypes
in interfaceorg.hibernate.usertype.UserType
-
returnedClass
public java.lang.Class returnedClass()
- Specified by:
returnedClass
in interfaceorg.hibernate.usertype.UserType
-
equals
public boolean equals(java.lang.Object obj1, java.lang.Object obj2) throws org.hibernate.HibernateException
- Specified by:
equals
in interfaceorg.hibernate.usertype.UserType
- Throws:
org.hibernate.HibernateException
-
hashCode
public int hashCode(java.lang.Object obj) throws org.hibernate.HibernateException
- Specified by:
hashCode
in interfaceorg.hibernate.usertype.UserType
- Throws:
org.hibernate.HibernateException
-
nullSafeGet
public java.lang.Object nullSafeGet(java.sql.ResultSet resultSet, java.lang.String[] names, org.hibernate.engine.spi.SharedSessionContractImplementor sessionImplementor, java.lang.Object owner) throws org.hibernate.HibernateException, java.sql.SQLException
- Specified by:
nullSafeGet
in interfaceorg.hibernate.usertype.UserType
- Throws:
org.hibernate.HibernateException
java.sql.SQLException
-
nullSafeSet
public void nullSafeSet(java.sql.PreparedStatement ps, java.lang.Object value, int index, org.hibernate.engine.spi.SharedSessionContractImplementor sessionImplementor) throws org.hibernate.HibernateException, java.sql.SQLException
- Specified by:
nullSafeSet
in interfaceorg.hibernate.usertype.UserType
- Throws:
org.hibernate.HibernateException
java.sql.SQLException
-
deepCopy
public java.lang.Object deepCopy(java.lang.Object obj) throws org.hibernate.HibernateException
- Specified by:
deepCopy
in interfaceorg.hibernate.usertype.UserType
- Throws:
org.hibernate.HibernateException
-
isMutable
public boolean isMutable()
- Specified by:
isMutable
in interfaceorg.hibernate.usertype.UserType
-
disassemble
public java.io.Serializable disassemble(java.lang.Object obj) throws org.hibernate.HibernateException
- Specified by:
disassemble
in interfaceorg.hibernate.usertype.UserType
- Throws:
org.hibernate.HibernateException
-
assemble
public java.lang.Object assemble(java.io.Serializable cached, java.lang.Object owner) throws org.hibernate.HibernateException
- Specified by:
assemble
in interfaceorg.hibernate.usertype.UserType
- Throws:
org.hibernate.HibernateException
-
replace
public java.lang.Object replace(java.lang.Object original, java.lang.Object target, java.lang.Object owner) throws org.hibernate.HibernateException
- Specified by:
replace
in interfaceorg.hibernate.usertype.UserType
- Throws:
org.hibernate.HibernateException
-
setParameterValues
public void setParameterValues(java.util.Properties parameters)
- Specified by:
setParameterValues
in interfaceorg.hibernate.usertype.ParameterizedType
-
-