net.sourceforge.xconf.toolbox.hibernate3
Class EnumType

java.lang.Object
  extended by net.sourceforge.xconf.toolbox.hibernate3.ImmutableUserType
      extended by net.sourceforge.xconf.toolbox.hibernate3.EnumType
All Implemented Interfaces:
UserType

public class EnumType
extends ImmutableUserType

Base class for Hibernate types that persist Enum subclasses as VARCHAR fields.

Author:
Tom Czarniecki

Constructor Summary
EnumType(Enum prototype)
          Requires an instance of the Enum subclass to resolve rather than the subclass' Class element to avoid bizzare uninitialised errors that occur on JDK 1.5 with Commons-Lang 2.1 EnumUtils utility methods.
 
Method Summary
 Object nullSafeGet(ResultSet rs, String[] names, Object owner)
           
 void nullSafeSet(PreparedStatement st, Object value, int index)
           
 Class returnedClass()
           
 int[] sqlTypes()
           
 
Methods inherited from class net.sourceforge.xconf.toolbox.hibernate3.ImmutableUserType
assemble, deepCopy, disassemble, equals, hashCode, isMutable, replace
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EnumType

public EnumType(Enum prototype)
Requires an instance of the Enum subclass to resolve rather than the subclass' Class element to avoid bizzare uninitialised errors that occur on JDK 1.5 with Commons-Lang 2.1 EnumUtils utility methods.

Method Detail

sqlTypes

public int[] sqlTypes()

returnedClass

public Class returnedClass()

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


Copyright © 2007 Thomas Czarniecki. All Rights Reserved.