org.springframework.orm.hibernate.support
Class ClobStringType

java.lang.Object
  extended byorg.springframework.orm.hibernate.support.ClobStringType
All Implemented Interfaces:
net.sf.hibernate.UserType

public class ClobStringType
extends java.lang.Object
implements net.sf.hibernate.UserType

Hibernate UserType implementation for Strings that get mapped to CLOBs. Retrieves the LobHandler to use from LocalSessionFactoryBean at config time.

Particularly useful for storing Strings with more than 4000 characters in an Oracle database (only possible via CLOBs), in combination with OracleLobHandler.

Can also be defined in generic Hibernate mappings, as DefaultLobCreator will work with most JDBC-compliant databases respectively drivers. In this case, the field type does not have to be CLOB: For databases like MySQL and MS SQL Server, any large enough text type will work.

Since:
12.01.2004
Author:
Juergen Hoeller
See Also:
LocalSessionFactoryBean.setLobHandler(org.springframework.jdbc.support.lob.LobHandler), LobHandler

Field Summary
protected  LobHandler lobHandler
           
 
Constructor Summary
ClobStringType()
           
 
Method Summary
 java.lang.Object deepCopy(java.lang.Object value)
           
 boolean equals(java.lang.Object x, java.lang.Object y)
           
 boolean isMutable()
           
 java.lang.Object nullSafeGet(java.sql.ResultSet rs, java.lang.String[] names, java.lang.Object owner)
           
 void nullSafeSet(java.sql.PreparedStatement st, java.lang.Object value, int index)
           
 java.lang.Class returnedClass()
           
 int[] sqlTypes()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

lobHandler

protected final LobHandler lobHandler
Constructor Detail

ClobStringType

public ClobStringType()
Method Detail

sqlTypes

public int[] sqlTypes()
Specified by:
sqlTypes in interface net.sf.hibernate.UserType

returnedClass

public java.lang.Class returnedClass()
Specified by:
returnedClass in interface net.sf.hibernate.UserType

equals

public boolean equals(java.lang.Object x,
                      java.lang.Object y)
Specified by:
equals in interface net.sf.hibernate.UserType

nullSafeGet

public java.lang.Object nullSafeGet(java.sql.ResultSet rs,
                                    java.lang.String[] names,
                                    java.lang.Object owner)
                             throws java.sql.SQLException
Specified by:
nullSafeGet in interface net.sf.hibernate.UserType
Throws:
java.sql.SQLException

nullSafeSet

public void nullSafeSet(java.sql.PreparedStatement st,
                        java.lang.Object value,
                        int index)
                 throws java.sql.SQLException
Specified by:
nullSafeSet in interface net.sf.hibernate.UserType
Throws:
java.sql.SQLException

deepCopy

public java.lang.Object deepCopy(java.lang.Object value)
Specified by:
deepCopy in interface net.sf.hibernate.UserType

isMutable

public boolean isMutable()
Specified by:
isMutable in interface net.sf.hibernate.UserType


Copyright (C) 2003-2004 The Spring Framework Project.