org.hibernatespatial
Class GeometryUserType

java.lang.Object
  extended by org.hibernatespatial.GeometryUserType
All Implemented Interfaces:
Serializable, org.hibernate.usertype.ParameterizedType, org.hibernate.usertype.UserType

public class GeometryUserType
extends Object
implements org.hibernate.usertype.UserType, org.hibernate.usertype.ParameterizedType, Serializable

This class ensures that Hibernate can work with the JTS Geometry type.

To properly convert Geometry objects to database specific wrapper objects, acces is needed to a spatially enabled database dialect. This dialect can be specified as a parameter to the type. If no parameter is supplied, the default Dialect will be used (set in HBSpatialExtension).

Author:
Karel Maesen
See Also:
Serialized Form

Field Summary
static String DIALECT_PARAM_NAME
           
static org.hibernate.type.CustomType TYPE
           
 
Constructor Summary
GeometryUserType()
           
 
Method Summary
 Object assemble(Serializable arg0, Object arg1)
           
 Object deepCopy(Object arg0)
           
 Serializable disassemble(Object arg0)
           
 boolean equals(Object obj)
           
 boolean equals(Object arg0, Object arg1)
           
 int hashCode()
           
 int hashCode(Object arg0)
           
 boolean isMutable()
           
 Object nullSafeGet(ResultSet arg0, String[] arg1, Object arg2)
           
 void nullSafeSet(PreparedStatement arg0, Object arg1, int arg2)
           
 Object replace(Object arg0, Object arg1, Object arg2)
           
 Class returnedClass()
           
 void setParameterValues(Properties properties)
           
 int[] sqlTypes()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

DIALECT_PARAM_NAME

public static String DIALECT_PARAM_NAME

TYPE

public static final org.hibernate.type.CustomType TYPE
Constructor Detail

GeometryUserType

public GeometryUserType()
Method Detail

assemble

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

deepCopy

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

disassemble

public Serializable disassemble(Object arg0)
                         throws org.hibernate.HibernateException
Specified by:
disassemble in interface org.hibernate.usertype.UserType
Parameters:
arg0 -
Returns:
Throws:
org.hibernate.HibernateException
See Also:
UserType.disassemble(java.lang.Object)

equals

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

equals

public boolean equals(Object obj)
Overrides:
equals in class Object
Parameters:
obj -
Returns:
See Also:
Object.equals(java.lang.Object)

hashCode

public int hashCode()
Overrides:
hashCode in class Object
Returns:
See Also:
Object.hashCode()

hashCode

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

isMutable

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

nullSafeGet

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

nullSafeSet

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

replace

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

returnedClass

public Class returnedClass()
Specified by:
returnedClass in interface org.hibernate.usertype.UserType
Returns:
See Also:
UserType.returnedClass()

sqlTypes

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

toString

public String toString()
Overrides:
toString in class Object
Returns:
See Also:
Object.toString()

setParameterValues

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


Copyright © 2011 hibernatespatial.org. All Rights Reserved.