|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.orm.hibernate.support.AbstractLobType
Abstract base class for Hibernate UserType implementations that map to LOBs. Retrieves the LobHandler to use from LocalSessionFactoryBean at config time.
Requires either active Spring transaction synchronization or a specified "jtaTransactionManager" on LocalSessionFactoryBean plus an active JTA transaction.
Offers template methods for getting and setting that pass in the LobHandler respectively LobCreator to use.
LobHandler
,
LocalSessionFactoryBean.setLobHandler(org.springframework.jdbc.support.lob.LobHandler)
,
LocalSessionFactoryBean.setJtaTransactionManager(javax.transaction.TransactionManager)
Field Summary | |
protected org.apache.commons.logging.Log |
logger
|
Constructor Summary | |
protected |
AbstractLobType()
Constructor used by Hibernate: fetches config-time LobHandler and config-time JTA TransactionManager from LocalSessionFactoryBean. |
protected |
AbstractLobType(LobHandler lobHandler,
javax.transaction.TransactionManager jtaTransactionManager)
Constructor used for testing: takes an explicit LobHandler and an explicit JTA TransactionManager (can be null). |
Method Summary | |
java.lang.Object |
deepCopy(java.lang.Object value)
This implementation returns the passed-in value as-is. |
boolean |
equals(java.lang.Object x,
java.lang.Object y)
This implementation delegates to the Hibernate EqualsHelper. |
boolean |
isMutable()
This implementation returns false. |
java.lang.Object |
nullSafeGet(java.sql.ResultSet rs,
java.lang.String[] names,
java.lang.Object owner)
This implementation delegates to nullSafeGetInternal, passing in the LobHandler of this type. |
protected abstract java.lang.Object |
nullSafeGetInternal(java.sql.ResultSet rs,
int index,
LobHandler lobHandler)
Template method to extract a value from the given result set. |
void |
nullSafeSet(java.sql.PreparedStatement st,
java.lang.Object value,
int index)
This implementation delegates to nullSafeSetInternal, passing in a transaction-synchronized LobCreator for the LobHandler of this type. |
protected abstract void |
nullSafeSetInternal(java.sql.PreparedStatement ps,
int index,
java.lang.Object value,
LobCreator lobCreator)
Template method to set the given value on the given statement. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface net.sf.hibernate.UserType |
returnedClass, sqlTypes |
Field Detail |
protected final org.apache.commons.logging.Log logger
Constructor Detail |
protected AbstractLobType()
LocalSessionFactoryBean.getConfigTimeLobHandler()
,
LocalSessionFactoryBean.getConfigTimeTransactionManager()
protected AbstractLobType(LobHandler lobHandler, javax.transaction.TransactionManager jtaTransactionManager)
Method Detail |
public boolean isMutable()
isMutable
in interface net.sf.hibernate.UserType
public boolean equals(java.lang.Object x, java.lang.Object y) throws net.sf.hibernate.HibernateException
equals
in interface net.sf.hibernate.UserType
net.sf.hibernate.HibernateException
EqualsHelper.equals(java.lang.Object, java.lang.Object)
public java.lang.Object deepCopy(java.lang.Object value) throws net.sf.hibernate.HibernateException
deepCopy
in interface net.sf.hibernate.UserType
net.sf.hibernate.HibernateException
public final java.lang.Object nullSafeGet(java.sql.ResultSet rs, java.lang.String[] names, java.lang.Object owner) throws net.sf.hibernate.HibernateException, java.sql.SQLException
nullSafeGet
in interface net.sf.hibernate.UserType
net.sf.hibernate.HibernateException
java.sql.SQLException
nullSafeGetInternal(java.sql.ResultSet, int, org.springframework.jdbc.support.lob.LobHandler)
public final void nullSafeSet(java.sql.PreparedStatement st, java.lang.Object value, int index) throws net.sf.hibernate.HibernateException, java.sql.SQLException
nullSafeSet
in interface net.sf.hibernate.UserType
net.sf.hibernate.HibernateException
java.sql.SQLException
nullSafeSetInternal(java.sql.PreparedStatement, int, java.lang.Object, org.springframework.jdbc.support.lob.LobCreator)
protected abstract java.lang.Object nullSafeGetInternal(java.sql.ResultSet rs, int index, LobHandler lobHandler) throws java.sql.SQLException, java.io.IOException, net.sf.hibernate.HibernateException
rs
- the ResultSet to extract fromindex
- the index in the ResultSetlobHandler
- the LobHandler to use
java.sql.SQLException
- if thrown by JDBC methods
java.io.IOException
- if thrown by streaming methods
net.sf.hibernate.HibernateException
- in case of any other exceptionsprotected abstract void nullSafeSetInternal(java.sql.PreparedStatement ps, int index, java.lang.Object value, LobCreator lobCreator) throws java.sql.SQLException, java.io.IOException, net.sf.hibernate.HibernateException
ps
- the PreparedStatement to set onindex
- the statement parameter indexvalue
- the value to setlobCreator
- the LobCreator to use
java.sql.SQLException
- if thrown by JDBC methods
java.io.IOException
- if thrown by streaming methods
net.sf.hibernate.HibernateException
- in case of any other exceptions
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |