|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.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 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,
TransactionManager jtaTransactionManager)
Constructor used for testing: takes an explicit LobHandler and an explicit JTA TransactionManager (can be null). |
| Method Summary | |
Object |
deepCopy(Object value)
This implementation returns the passed-in value as-is. |
boolean |
equals(Object x,
Object y)
This implementation delegates to the Hibernate EqualsHelper. |
boolean |
isMutable()
This implementation returns false. |
Object |
nullSafeGet(ResultSet rs,
String[] names,
Object owner)
This implementation delegates to nullSafeGetInternal, passing in the LobHandler of this type. |
protected abstract Object |
nullSafeGetInternal(ResultSet rs,
int index,
LobHandler lobHandler)
Template method to extract a value from the given result set. |
void |
nullSafeSet(PreparedStatement st,
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(PreparedStatement ps,
int index,
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 Log logger
| Constructor Detail |
protected AbstractLobType()
LocalSessionFactoryBean.getConfigTimeLobHandler(),
LocalSessionFactoryBean.getConfigTimeTransactionManager()
protected AbstractLobType(LobHandler lobHandler,
TransactionManager jtaTransactionManager)
| Method Detail |
public boolean isMutable()
isMutable in interface UserType
public boolean equals(Object x,
Object y)
throws HibernateException
equals in interface UserTypeHibernateExceptionEqualsHelper.equals(java.lang.Object, java.lang.Object)
public Object deepCopy(Object value)
throws HibernateException
deepCopy in interface UserTypeHibernateException
public final Object nullSafeGet(ResultSet rs,
String[] names,
Object owner)
throws HibernateException,
SQLException
nullSafeGet in interface UserTypeHibernateException
SQLExceptionnullSafeGetInternal(java.sql.ResultSet, int, org.springframework.jdbc.support.lob.LobHandler)
public final void nullSafeSet(PreparedStatement st,
Object value,
int index)
throws HibernateException,
SQLException
nullSafeSet in interface UserTypeHibernateException
SQLExceptionnullSafeSetInternal(java.sql.PreparedStatement, int, java.lang.Object, org.springframework.jdbc.support.lob.LobCreator)
protected abstract Object nullSafeGetInternal(ResultSet rs,
int index,
LobHandler lobHandler)
throws SQLException,
IOException,
HibernateException
rs - the ResultSet to extract fromindex - the index in the ResultSetlobHandler - the LobHandler to use
SQLException - if thrown by JDBC methods
IOException - if thrown by streaming methods
HibernateException - in case of any other exceptions
protected abstract void nullSafeSetInternal(PreparedStatement ps,
int index,
Object value,
LobCreator lobCreator)
throws SQLException,
IOException,
HibernateException
ps - the PreparedStatement to set onindex - the statement parameter indexvalue - the value to setlobCreator - the LobCreator to use
SQLException - if thrown by JDBC methods
IOException - if thrown by streaming methods
HibernateException - in case of any other exceptions
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||