jcolibri.connector.databaseutils
Class GenericUserType

java.lang.Object
  extended by jcolibri.connector.databaseutils.GenericUserType
All Implemented Interfaces:
org.hibernate.usertype.ParameterizedType, org.hibernate.usertype.UserType

public class GenericUserType
extends java.lang.Object
implements org.hibernate.usertype.UserType, org.hibernate.usertype.ParameterizedType

Class that allows to use any jcolibri.connector.TypeAdaptor class in the DataBaseConnector.

This is a Hibernate subclass that wraps any user defined data type. This way it can be persisted into the data base easly.

Version:
2.0
Author:
Juan A. Recio-García
See Also:
TypeAdaptor

Constructor Summary
GenericUserType()
           
 
Method Summary
 java.lang.Object assemble(java.io.Serializable arg0, java.lang.Object arg1)
           
 java.lang.Object deepCopy(java.lang.Object arg0)
           
 java.io.Serializable disassemble(java.lang.Object arg0)
           
 boolean equals(java.lang.Object arg0, java.lang.Object arg1)
           
 int hashCode(java.lang.Object arg0)
           
 boolean isMutable()
           
 java.lang.Object nullSafeGet(java.sql.ResultSet arg0, java.lang.String[] arg1, java.lang.Object arg2)
           
 void nullSafeSet(java.sql.PreparedStatement arg0, java.lang.Object arg1, int i)
           
 java.lang.Object replace(java.lang.Object arg0, java.lang.Object arg1, java.lang.Object arg2)
           
 java.lang.Class returnedClass()
           
 void setParameterValues(java.util.Properties params)
           
 int[] sqlTypes()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GenericUserType

public GenericUserType()
Method Detail

setParameterValues

public void setParameterValues(java.util.Properties params)
Specified by:
setParameterValues in interface org.hibernate.usertype.ParameterizedType

assemble

public java.lang.Object assemble(java.io.Serializable arg0,
                                 java.lang.Object arg1)
                          throws org.hibernate.HibernateException
Specified by:
assemble in interface org.hibernate.usertype.UserType
Throws:
org.hibernate.HibernateException

disassemble

public java.io.Serializable disassemble(java.lang.Object arg0)
                                 throws org.hibernate.HibernateException
Specified by:
disassemble in interface org.hibernate.usertype.UserType
Throws:
org.hibernate.HibernateException

deepCopy

public java.lang.Object deepCopy(java.lang.Object arg0)
                          throws org.hibernate.HibernateException
Specified by:
deepCopy in interface org.hibernate.usertype.UserType
Throws:
org.hibernate.HibernateException

equals

public boolean equals(java.lang.Object arg0,
                      java.lang.Object arg1)
               throws org.hibernate.HibernateException
Specified by:
equals in interface org.hibernate.usertype.UserType
Throws:
org.hibernate.HibernateException

hashCode

public int hashCode(java.lang.Object arg0)
             throws org.hibernate.HibernateException
Specified by:
hashCode in interface org.hibernate.usertype.UserType
Throws:
org.hibernate.HibernateException

isMutable

public boolean isMutable()
Specified by:
isMutable in interface org.hibernate.usertype.UserType

nullSafeGet

public java.lang.Object nullSafeGet(java.sql.ResultSet arg0,
                                    java.lang.String[] arg1,
                                    java.lang.Object arg2)
                             throws org.hibernate.HibernateException,
                                    java.sql.SQLException
Specified by:
nullSafeGet in interface org.hibernate.usertype.UserType
Throws:
org.hibernate.HibernateException
java.sql.SQLException

nullSafeSet

public void nullSafeSet(java.sql.PreparedStatement arg0,
                        java.lang.Object arg1,
                        int i)
                 throws org.hibernate.HibernateException,
                        java.sql.SQLException
Specified by:
nullSafeSet in interface org.hibernate.usertype.UserType
Throws:
org.hibernate.HibernateException
java.sql.SQLException

replace

public java.lang.Object replace(java.lang.Object arg0,
                                java.lang.Object arg1,
                                java.lang.Object arg2)
                         throws org.hibernate.HibernateException
Specified by:
replace in interface org.hibernate.usertype.UserType
Throws:
org.hibernate.HibernateException

returnedClass

public java.lang.Class returnedClass()
Specified by:
returnedClass in interface org.hibernate.usertype.UserType

sqlTypes

public int[] sqlTypes()
Specified by:
sqlTypes in interface org.hibernate.usertype.UserType

GAIA - Group for Artificial Intelligence Applications
http://gaia.fdi.ucm.es