ch.elca.el4j.services.persistence.hibernate.usertypes
Class GenericEnumUserType

java.lang.Object
  extended by ch.elca.el4j.services.persistence.hibernate.usertypes.AbstractGenericEnumUserType
      extended by ch.elca.el4j.services.persistence.hibernate.usertypes.GenericEnumUserType
All Implemented Interfaces:
ParameterizedType, UserType

public class GenericEnumUserType
extends AbstractGenericEnumUserType

Generic user type for enumerations. Based on http://weblog.dangertree.net/2007/09/23/mapping-java-5-enums-with-hibernate/

Author:
Martin Zeltner (MZE), Stefan Wismer (SWI)
File-location:
GenericEnumUserType
Last check-in date:
2009-12-01 12:19:40 +0100 (Di, 01. Dez 2009) by jonasha for revision 4014

Field Summary
 
Fields inherited from class ch.elca.el4j.services.persistence.hibernate.usertypes.AbstractGenericEnumUserType
m_enumClass, m_sqlTypes, m_type, m_valueMapping
 
Constructor Summary
GenericEnumUserType()
           
 
Method Summary
 Object assemble(Serializable cached, Object owner)
          
 Object deepCopy(Object value)
          
 Serializable disassemble(Object value)
          
 boolean equals(Object x, Object y)
          
 int hashCode(Object x)
          
 boolean isMutable()
          
 Object nullSafeGet(ResultSet rs, String[] names, Object owner)
          
 void nullSafeSet(PreparedStatement st, Object value, int index)
          
 Object replace(Object original, Object target, Object owner)
          
 void setParameterValues(Properties parameters)
          
 
Methods inherited from class ch.elca.el4j.services.persistence.hibernate.usertypes.AbstractGenericEnumUserType
getEnumValues, returnedClass, sqlTypes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GenericEnumUserType

public GenericEnumUserType()
Method Detail

setParameterValues

public void setParameterValues(Properties parameters)

Specified by:
setParameterValues in interface ParameterizedType
Overrides:
setParameterValues in class AbstractGenericEnumUserType

nullSafeGet

public Object nullSafeGet(ResultSet rs,
                          String[] names,
                          Object owner)
                   throws HibernateException,
                          SQLException

Throws:
HibernateException
SQLException

nullSafeSet

public void nullSafeSet(PreparedStatement st,
                        Object value,
                        int index)
                 throws HibernateException,
                        SQLException

Throws:
HibernateException
SQLException

assemble

public Object assemble(Serializable cached,
                       Object owner)
                throws HibernateException

Throws:
HibernateException

deepCopy

public Object deepCopy(Object value)
                throws HibernateException

Throws:
HibernateException

disassemble

public Serializable disassemble(Object value)
                         throws HibernateException

Throws:
HibernateException

equals

public boolean equals(Object x,
                      Object y)
               throws HibernateException

Throws:
HibernateException

hashCode

public int hashCode(Object x)
             throws HibernateException

Throws:
HibernateException

isMutable

public boolean isMutable()


replace

public Object replace(Object original,
                      Object target,
                      Object owner)
               throws HibernateException

Throws:
HibernateException


Copyright © 2005-2011 ELCA. All Rights Reserved.