org.jcoderz.commons.util
Class DateUserType

java.lang.Object
  extended by org.jcoderz.commons.util.UserTypeBase
      extended by org.jcoderz.commons.util.DateUserType
All Implemented Interfaces:
Serializable, org.hibernate.usertype.UserType

public class DateUserType
extends UserTypeBase

This is the Hibernate user type that maps a Date to a timestamp in the Database.

Author:
Andreas Mandel
See Also:
Serialized Form

Constructor Summary
DateUserType()
           
 
Method Summary
static org.hibernate.type.Type getType()
          Hibernate org.jcoderz.commons.types.Date type as mapped from this UserType.
 Object nullSafeGet(ResultSet resultSet, String[] types, Object owner)
          
 void nullSafeSet(PreparedStatement statement, Object value, int index)
          
 Class returnedClass()
          
 int[] sqlTypes()
          
 
Methods inherited from class org.jcoderz.commons.util.UserTypeBase
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
 

Constructor Detail

DateUserType

public DateUserType()
Method Detail

getType

public static org.hibernate.type.Type getType()
Hibernate org.jcoderz.commons.types.Date type as mapped from this UserType.

Returns:
this UserType as org.hibernate.type.Type.

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

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

returnedClass

public Class returnedClass()

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

sqlTypes

public int[] sqlTypes()

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


Copyright 2007 The jCoderZ Project.