ca.uhn.cache.internal.hibernate
Class HibernateEnum

java.lang.Object
  extended byca.uhn.cache.internal.hibernate.HibernateEnum
All Implemented Interfaces:
net.sf.hibernate.UserType
Direct Known Subclasses:
HibernateCacheReasonEnum, HibernateVolatilityEnum

public abstract class HibernateEnum
extends java.lang.Object
implements net.sf.hibernate.UserType

Used to allow Hibernate to persist Jakarta Commons Enums.

Example usage:
 
 public class Gender extends Enum {
    ...
 }
 
 public class HibernateGender extends HibernateEnumUserType {
      public HibernateGender() {
          super( Gender.class );
      }
 }
 
 public class Person {
      ...
      /**
       * @hibernate.property class="HibernateGender"
       *
      public Gender getGender() {
          return myGender;
      }
 }
 

Author:

Constructor Summary
protected HibernateEnum(java.lang.Class theEnumType)
           
 
Method Summary
 java.lang.Object deepCopy(java.lang.Object theValue)
          
 boolean equals(java.lang.Object theX, java.lang.Object theY)
          
 boolean isMutable()
          
 java.lang.Object nullSafeGet(java.sql.ResultSet theResultSet, java.lang.String[] theNames, java.lang.Object theOwner)
          
 void nullSafeSet(java.sql.PreparedStatement theStatement, java.lang.Object theValue, int theIndex)
          
 java.lang.Class returnedClass()
          
 int[] sqlTypes()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HibernateEnum

protected HibernateEnum(java.lang.Class theEnumType)
Method Detail

sqlTypes

public int[] sqlTypes()

Specified by:
sqlTypes in interface net.sf.hibernate.UserType

returnedClass

public java.lang.Class returnedClass()

Specified by:
returnedClass in interface net.sf.hibernate.UserType

deepCopy

public java.lang.Object deepCopy(java.lang.Object theValue)

Specified by:
deepCopy in interface net.sf.hibernate.UserType

isMutable

public boolean isMutable()

Specified by:
isMutable in interface net.sf.hibernate.UserType

nullSafeGet

public java.lang.Object nullSafeGet(java.sql.ResultSet theResultSet,
                                    java.lang.String[] theNames,
                                    java.lang.Object theOwner)
                             throws net.sf.hibernate.HibernateException,
                                    java.sql.SQLException

Specified by:
nullSafeGet in interface net.sf.hibernate.UserType
Throws:
net.sf.hibernate.HibernateException
java.sql.SQLException

nullSafeSet

public void nullSafeSet(java.sql.PreparedStatement theStatement,
                        java.lang.Object theValue,
                        int theIndex)
                 throws net.sf.hibernate.HibernateException,
                        java.sql.SQLException

Specified by:
nullSafeSet in interface net.sf.hibernate.UserType
Throws:
net.sf.hibernate.HibernateException
java.sql.SQLException

equals

public boolean equals(java.lang.Object theX,
                      java.lang.Object theY)
               throws net.sf.hibernate.HibernateException

Specified by:
equals in interface net.sf.hibernate.UserType
Throws:
net.sf.hibernate.HibernateException


Copyright © 2004-2005 University Health Network. All Rights Reserved.