com.atlassian.bamboo.hibernate
Class GenericEnumUserType<T extends java.lang.Enum>

java.lang.Object
  extended by com.atlassian.bamboo.hibernate.GenericEnumUserType<T>
Type Parameters:
T -
All Implemented Interfaces:
net.sf.hibernate.UserType
Direct Known Subclasses:
BranchIntegrationStateUserType, BranchIntegrationStrategyUserType, EC2ArchitectureUserType, EC2InstanceTypeUserType, EC2PlatformUserType, EC2RegionUserType, EC2RootDeviceTypeUserType, NotificationSetTypeUserType, TestDeltaStateUserType, TestStateUserType, VariableTypeUserType

public abstract class GenericEnumUserType<T extends java.lang.Enum>
extends java.lang.Object
implements net.sf.hibernate.UserType

Generic Hibernate UserType implementation for enums. DB holds a string representation of enum's name.


Constructor Summary
protected GenericEnumUserType(java.lang.Class<T> enumClass)
           
 
Method Summary
 java.lang.Object deepCopy(java.lang.Object value)
           
 boolean equals(java.lang.Object x, java.lang.Object y)
           
 boolean isMutable()
           
 java.lang.Object nullSafeGet(java.sql.ResultSet rs, java.lang.String[] names, java.lang.Object owner)
           
 void nullSafeSet(java.sql.PreparedStatement st, java.lang.Object value, int index)
           
 java.lang.Class<? extends java.lang.Enum> returnedClass()
           
 int[] sqlTypes()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GenericEnumUserType

protected GenericEnumUserType(java.lang.Class<T> enumClass)
Method Detail

sqlTypes

public int[] sqlTypes()
Specified by:
sqlTypes in interface net.sf.hibernate.UserType

returnedClass

public java.lang.Class<? extends java.lang.Enum> returnedClass()
Specified by:
returnedClass in interface net.sf.hibernate.UserType

equals

public boolean equals(java.lang.Object x,
                      java.lang.Object y)
               throws net.sf.hibernate.HibernateException
Specified by:
equals in interface net.sf.hibernate.UserType
Throws:
net.sf.hibernate.HibernateException

nullSafeGet

public java.lang.Object nullSafeGet(java.sql.ResultSet rs,
                                    java.lang.String[] names,
                                    java.lang.Object owner)
                             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 st,
                        java.lang.Object value,
                        int index)
                 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

deepCopy

public java.lang.Object deepCopy(java.lang.Object value)
                          throws net.sf.hibernate.HibernateException
Specified by:
deepCopy in interface net.sf.hibernate.UserType
Throws:
net.sf.hibernate.HibernateException

isMutable

public boolean isMutable()
Specified by:
isMutable in interface net.sf.hibernate.UserType


Copyright © 2012 Atlassian. All Rights Reserved.