org.jcoderz.commons.util
Class LongUserTypeBase

java.lang.Object
  extended by org.jcoderz.commons.util.UserTypeBase
      extended by org.jcoderz.commons.util.LongUserTypeBase
All Implemented Interfaces:
Serializable, org.hibernate.usertype.UserType
Direct Known Subclasses:
SampleLongUserType

public abstract class LongUserTypeBase
extends UserTypeBase

This class is used by the Hibernate binding for long based strong types.

Author:
Andreas Mandel
See Also:
Serialized Form

Constructor Summary
LongUserTypeBase()
           
 
Method Summary
abstract  Object fromLong(long value)
          Implement this method for the particular StrongType.
 Object nullSafeGet(ResultSet resultSet, String[] types, Object owner)
          
 void nullSafeSet(PreparedStatement statement, Object value, int index)
          
 int[] sqlTypes()
          
abstract  long toLong(Object value)
          Implement this method for the particular StrongType.
 
Methods inherited from class org.jcoderz.commons.util.UserTypeBase
assemble, deepCopy, disassemble, equals, hashCode, isMutable, replace, returnedClass
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LongUserTypeBase

public LongUserTypeBase()
Method Detail

nullSafeGet

public Object nullSafeGet(ResultSet resultSet,
                          String[] types,
                          Object owner)
                   throws org.hibernate.HibernateException,
                          SQLException

Specified by:
nullSafeGet in interface org.hibernate.usertype.UserType
Specified by:
nullSafeGet in class UserTypeBase
Throws:
org.hibernate.HibernateException
SQLException

fromLong

public abstract Object fromLong(long value)
Implement this method for the particular StrongType.

Parameters:
value - the long representation of the mapped class
Returns:
the instance of the mapped class

toLong

public abstract long toLong(Object value)
Implement this method for the particular StrongType.

Parameters:
value - the StrongType to be converted into its numeric representation.
Returns:
the long representation of the value given.

nullSafeSet

public void nullSafeSet(PreparedStatement statement,
                        Object value,
                        int index)
                 throws org.hibernate.HibernateException,
                        SQLException

Specified by:
nullSafeSet in interface org.hibernate.usertype.UserType
Specified by:
nullSafeSet in class UserTypeBase
Throws:
org.hibernate.HibernateException
SQLException

sqlTypes

public int[] sqlTypes()

Specified by:
sqlTypes in interface org.hibernate.usertype.UserType
Specified by:
sqlTypes in class UserTypeBase


Copyright 2007 The jCoderZ Project.