public abstract class AbstractLobType
extends java.lang.Object
For writing LOBs, either an active Spring transaction synchronization or an active JTA transaction (with "jtaTransactionManager" specified on LocalSessionFactoryBean or a Hibernate TransactionManagerLookup configured through the corresponding Hibernate property) is required.
Offers template methods for setting parameters and getting result values, passing in the LobHandler or LobCreator to use.
LobHandler
,
LobCreator
,
LocalSessionFactoryBean.setLobHandler(org.springframework.jdbc.support.lob.LobHandler)
,
LocalSessionFactoryBean.setJtaTransactionManager(TransactionManager)
Modifier and Type | Field and Description |
---|---|
private TransactionManager |
jtaTransactionManager |
private LobHandler |
lobHandler |
protected Log |
logger |
Modifier | Constructor and Description |
---|---|
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 ). |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
assemble(java.io.Serializable cached,
java.lang.Object owner)
This implementation returns the passed-in value as-is.
|
java.lang.Object |
deepCopy(java.lang.Object value)
This implementation returns the passed-in value as-is.
|
java.io.Serializable |
disassemble(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.
|
int |
hashCode(java.lang.Object x)
This implementation returns the hashCode of the given objectz.
|
boolean |
isMutable()
This implementation returns false.
|
java.lang.Object |
nullSafeGet(java.sql.ResultSet rs,
java.lang.String[] names,
java.lang.Object owner)
Deprecated.
|
protected abstract java.lang.Object |
nullSafeGetInternal(java.sql.ResultSet rs,
java.lang.String[] names,
java.lang.Object owner,
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)
Deprecated.
|
protected abstract void |
nullSafeSetInternal(java.sql.PreparedStatement ps,
int index,
java.lang.Object value,
LobCreator lobCreator)
Template method to set the given parameter value on the given statement.
|
java.lang.Object |
replace(java.lang.Object original,
java.lang.Object target,
java.lang.Object owner)
This implementation returns the passed-in original as-is.
|
protected final Log logger
private final LobHandler lobHandler
private final TransactionManager jtaTransactionManager
protected AbstractLobType()
protected AbstractLobType(LobHandler lobHandler, TransactionManager jtaTransactionManager)
null
).public boolean isMutable()
public boolean equals(java.lang.Object x, java.lang.Object y) throws HibernateException
HibernateException
org.hibernate.util.EqualsHelper#equals
public int hashCode(java.lang.Object x) throws HibernateException
HibernateException
public java.lang.Object deepCopy(java.lang.Object value) throws HibernateException
HibernateException
public java.io.Serializable disassemble(java.lang.Object value) throws HibernateException
HibernateException
public java.lang.Object assemble(java.io.Serializable cached, java.lang.Object owner) throws HibernateException
HibernateException
public java.lang.Object replace(java.lang.Object original, java.lang.Object target, java.lang.Object owner) throws HibernateException
HibernateException
@Deprecated public final java.lang.Object nullSafeGet(java.sql.ResultSet rs, java.lang.String[] names, java.lang.Object owner) throws HibernateException, java.sql.SQLException
HibernateException
java.sql.SQLException
nullSafeGetInternal(java.sql.ResultSet, java.lang.String[], java.lang.Object, org.springframework.jdbc.support.lob.LobHandler)
@Deprecated public final void nullSafeSet(java.sql.PreparedStatement st, java.lang.Object value, int index) throws HibernateException, java.sql.SQLException
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, java.lang.String[] names, java.lang.Object owner, LobHandler lobHandler) throws java.sql.SQLException, java.io.IOException, HibernateException
rs
- the ResultSet to extract fromnames
- the column namesowner
- the containing entitylobHandler
- the LobHandler to usejava.sql.SQLException
- if thrown by JDBC methodsjava.io.IOException
- if thrown by streaming methodsHibernateException
- 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, HibernateException
ps
- the PreparedStatement to set onindex
- the statement parameter indexvalue
- the value to setlobCreator
- the LobCreator to usejava.sql.SQLException
- if thrown by JDBC methodsjava.io.IOException
- if thrown by streaming methodsHibernateException
- in case of any other exceptions