|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.orm.hibernate3.support.AbstractLobType org.springframework.orm.hibernate3.support.ClobStringType
public class ClobStringType
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 database drivers. In this case, the field type does not have to be CLOB: For databases like MySQL and MS SQL Server, any large enough character type will work.
LocalSessionFactoryBean.setLobHandler(org.springframework.jdbc.support.lob.LobHandler)
Field Summary |
---|
Fields inherited from class org.springframework.orm.hibernate3.support.AbstractLobType |
---|
logger |
Constructor Summary | |
---|---|
|
ClobStringType()
Constructor used by Hibernate: fetches config-time LobHandler and config-time JTA TransactionManager from LocalSessionFactoryBean. |
protected |
ClobStringType(LobHandler lobHandler,
TransactionManager jtaTransactionManager)
Constructor used for testing: takes an explicit LobHandler and an explicit JTA TransactionManager (can be null ). |
Method Summary | |
---|---|
protected Object |
nullSafeGetInternal(ResultSet rs,
String[] names,
Object owner,
LobHandler lobHandler)
Template method to extract a value from the given result set. |
protected void |
nullSafeSetInternal(PreparedStatement ps,
int index,
Object value,
LobCreator lobCreator)
Template method to set the given parameter value on the given statement. |
Class |
returnedClass()
|
int[] |
sqlTypes()
|
Methods inherited from class org.springframework.orm.hibernate3.support.AbstractLobType |
---|
assemble, deepCopy, disassemble, equals, hashCode, isMutable, nullSafeGet, nullSafeSet, replace |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ClobStringType()
LocalSessionFactoryBean.getConfigTimeLobHandler()
,
LocalSessionFactoryBean.getConfigTimeTransactionManager()
protected ClobStringType(LobHandler lobHandler, TransactionManager jtaTransactionManager)
null
).
Method Detail |
---|
public int[] sqlTypes()
public Class returnedClass()
protected Object nullSafeGetInternal(ResultSet rs, String[] names, Object owner, LobHandler lobHandler) throws SQLException
AbstractLobType
nullSafeGetInternal
in class AbstractLobType
rs
- the ResultSet to extract fromnames
- the column namesowner
- the containing entitylobHandler
- the LobHandler to use
SQLException
- if thrown by JDBC methodsprotected void nullSafeSetInternal(PreparedStatement ps, int index, Object value, LobCreator lobCreator) throws SQLException
AbstractLobType
nullSafeSetInternal
in class AbstractLobType
ps
- the PreparedStatement to set onindex
- the statement parameter indexvalue
- the value to setlobCreator
- the LobCreator to use
SQLException
- if thrown by JDBC methods
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |