org.itracker.persistence.dao
Class EnumNameUserType
java.lang.Object
org.itracker.persistence.dao.AbstractEnumUserType
org.itracker.persistence.dao.EnumNameUserType
- All Implemented Interfaces:
- org.hibernate.usertype.EnhancedUserType, org.hibernate.usertype.ParameterizedType, org.hibernate.usertype.UserType
public class EnumNameUserType
- extends AbstractEnumUserType
Custom Hibernate UserType to persist a Java 5 enum constant as a VARCHAR
using its name.
Based on the original class by Gavin King
(http://www.hibernate.org/272.html).
- Author:
- johnny
|
Constructor Summary |
EnumNameUserType()
Default constructor, required by Hibernate. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
EnumNameUserType
public EnumNameUserType()
- Default constructor, required by Hibernate.
nullSafeGet
public Object nullSafeGet(ResultSet rs,
String[] names,
Object owner)
throws org.hibernate.HibernateException,
SQLException
- Throws:
org.hibernate.HibernateException
SQLException
nullSafeSet
public void nullSafeSet(PreparedStatement st,
Object value,
int index)
throws org.hibernate.HibernateException,
SQLException
- Throws:
org.hibernate.HibernateException
SQLException
sqlTypes
public int[] sqlTypes()
objectToSQLString
public String objectToSQLString(Object value)
toXMLString
public String toXMLString(Object value)
fromXMLString
public Object fromXMLString(String xmlValue)
Copyright © 2002-2012 itracker. All Rights Reserved.