org.kuali.rice.core.framework.persistence.jpa.type
Class HibernateKualiCharBooleanAIType

java.lang.Object
  extended by org.kuali.rice.core.framework.persistence.jpa.type.HibernateImmutableValueUserType
      extended by org.kuali.rice.core.framework.persistence.jpa.type.HibernateKualiCharBooleanAIType
All Implemented Interfaces:
org.hibernate.usertype.UserType

public class HibernateKualiCharBooleanAIType
extends HibernateImmutableValueUserType
implements org.hibernate.usertype.UserType

This class converts the "A" or "I" value from the database into a true or false in Java.

Author:
Kuali Rice Team (rice.collab@kuali.org)

Constructor Summary
HibernateKualiCharBooleanAIType()
           
 
Method Summary
 Object nullSafeGet(ResultSet rs, String[] names, Object owner)
          Retrieves a value from the given ResultSet
 void nullSafeSet(PreparedStatement st, Object value, int index)
          Abstract method for children to override - takes a Java value and changes it to be correctly added to the given PreparedStatement
 Class returnedClass()
          Returns String.class
 int[] sqlTypes()
          Returns an array with the SQL VARCHAR type as the single member
 
Methods inherited from class org.kuali.rice.core.framework.persistence.jpa.type.HibernateImmutableValueUserType
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
 
Methods inherited from interface org.hibernate.usertype.UserType
assemble, deepCopy, disassemble, equals, hashCode, isMutable, replace
 

Constructor Detail

HibernateKualiCharBooleanAIType

public HibernateKualiCharBooleanAIType()
Method Detail

nullSafeGet

public Object nullSafeGet(ResultSet rs,
                          String[] names,
                          Object owner)
                   throws org.hibernate.HibernateException,
                          SQLException
Retrieves a value from the given ResultSet

Specified by:
nullSafeGet in interface org.hibernate.usertype.UserType
Specified by:
nullSafeGet in class HibernateImmutableValueUserType
Throws:
org.hibernate.HibernateException
SQLException
See Also:
UserType.nullSafeGet(java.sql.ResultSet, java.lang.String[], java.lang.Object)

nullSafeSet

public void nullSafeSet(PreparedStatement st,
                        Object value,
                        int index)
                 throws org.hibernate.HibernateException,
                        SQLException
Description copied from class: HibernateImmutableValueUserType
Abstract method for children to override - takes a Java value and changes it to be correctly added to the given PreparedStatement

Specified by:
nullSafeSet in interface org.hibernate.usertype.UserType
Specified by:
nullSafeSet in class HibernateImmutableValueUserType
Throws:
org.hibernate.HibernateException
SQLException
See Also:
UserType.nullSafeSet(java.sql.PreparedStatement, java.lang.Object, int)

returnedClass

public Class returnedClass()
Returns String.class

Specified by:
returnedClass in interface org.hibernate.usertype.UserType
Specified by:
returnedClass in class HibernateImmutableValueUserType
See Also:
UserType.returnedClass()

sqlTypes

public int[] sqlTypes()
Returns an array with the SQL VARCHAR type as the single member

Specified by:
sqlTypes in interface org.hibernate.usertype.UserType
Specified by:
sqlTypes in class HibernateImmutableValueUserType
See Also:
UserType.sqlTypes()


Copyright © 2005-2012 The Kuali Foundation. All Rights Reserved.