Class AbstractLobType
- java.lang.Object
- org.springframework.orm.hibernate3.support.AbstractLobType
- All Implemented Interfaces:
UserType
- Direct Known Subclasses:
BlobByteArrayType
,BlobSerializableType
,BlobStringType
,ClobStringType
@Deprecated public abstract class AbstractLobType extends Object implements UserType
Deprecated.as of Spring 4.3, in favor of Hibernate 4.x/5.xAbstract base class for Hibernate UserType implementations that map to LOBs. Retrieves the LobHandler to use from LocalSessionFactoryBean at config time.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.
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractLobType()
Deprecated.Constructor used by Hibernate: fetches config-time LobHandler and config-time JTA TransactionManager from LocalSessionFactoryBean.protected
AbstractLobType(LobHandler lobHandler, TransactionManager jtaTransactionManager)
Deprecated.Constructor used for testing: takes an explicit LobHandler and an explicit JTA TransactionManager (can benull
).
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description Object
assemble(Serializable cached, Object owner)
Deprecated.This implementation returns the passed-in value as-is.Object
deepCopy(Object value)
Deprecated.This implementation returns the passed-in value as-is.Serializable
disassemble(Object value)
Deprecated.This implementation returns the passed-in value as-is.boolean
equals(Object x, Object y)
Deprecated.This implementation delegates to the Hibernate EqualsHelper.int
hashCode(Object x)
Deprecated.This implementation returns the hashCode of the given objectz.boolean
isMutable()
Deprecated.This implementation returns false.Object
nullSafeGet(ResultSet rs, String[] names, Object owner)
Deprecated.protected abstract Object
nullSafeGetInternal(ResultSet rs, String[] names, Object owner, LobHandler lobHandler)
Deprecated.Template method to extract a value from the given result set.void
nullSafeSet(PreparedStatement st, Object value, int index)
Deprecated.protected abstract void
nullSafeSetInternal(PreparedStatement ps, int index, Object value, LobCreator lobCreator)
Deprecated.Template method to set the given parameter value on the given statement.Object
replace(Object original, Object target, Object owner)
Deprecated.This implementation returns the passed-in original as-is.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.hibernate.usertype.UserType
nullSafeGet, nullSafeSet, returnedClass, sqlTypes
Constructor Detail
AbstractLobType
protected AbstractLobType()
Deprecated.Constructor used by Hibernate: fetches config-time LobHandler and config-time JTA TransactionManager from LocalSessionFactoryBean.
AbstractLobType
protected AbstractLobType(LobHandler lobHandler, TransactionManager jtaTransactionManager)
Deprecated.Constructor used for testing: takes an explicit LobHandler and an explicit JTA TransactionManager (can benull
).
Method Detail
isMutable
public boolean isMutable()
Deprecated.This implementation returns false.
equals
public boolean equals(Object x, Object y) throws HibernateException
Deprecated.This implementation delegates to the Hibernate EqualsHelper.- Specified by:
equals
in interfaceUserType
- Throws:
HibernateException
- See Also:
EqualsHelper.equals(java.lang.Object, java.lang.Object)
hashCode
public int hashCode(Object x) throws HibernateException
Deprecated.This implementation returns the hashCode of the given objectz.- Specified by:
hashCode
in interfaceUserType
- Throws:
HibernateException
deepCopy
public Object deepCopy(Object value) throws HibernateException
Deprecated.This implementation returns the passed-in value as-is.- Specified by:
deepCopy
in interfaceUserType
- Throws:
HibernateException
disassemble
public Serializable disassemble(Object value) throws HibernateException
Deprecated.This implementation returns the passed-in value as-is.- Specified by:
disassemble
in interfaceUserType
- Throws:
HibernateException
assemble
public Object assemble(Serializable cached, Object owner) throws HibernateException
Deprecated.This implementation returns the passed-in value as-is.- Specified by:
assemble
in interfaceUserType
- Throws:
HibernateException
replace
public Object replace(Object original, Object target, Object owner) throws HibernateException
Deprecated.This implementation returns the passed-in original as-is.- Specified by:
replace
in interfaceUserType
- Throws:
HibernateException
nullSafeGet
@Deprecated public final Object nullSafeGet(ResultSet rs, String[] names, Object owner) throws HibernateException, SQLException
Deprecated.This implementation delegates to nullSafeGetInternal, passing in the LobHandler of this type.
nullSafeSet
@Deprecated public final void nullSafeSet(PreparedStatement st, Object value, int index) throws HibernateException, SQLException
Deprecated.This implementation delegates to nullSafeSetInternal, passing in a transaction-synchronized LobCreator for the LobHandler of this type.
nullSafeGetInternal
protected abstract Object nullSafeGetInternal(ResultSet rs, String[] names, Object owner, LobHandler lobHandler) throws SQLException, IOException, HibernateException
Deprecated.Template method to extract a value from the given result set.- Parameters:
rs
- the ResultSet to extract fromnames
- the column namesowner
- the containing entitylobHandler
- the LobHandler to use- Returns:
- the extracted value
- Throws:
SQLException
- if thrown by JDBC methodsIOException
- if thrown by streaming methodsHibernateException
- in case of any other exceptions
nullSafeSetInternal
protected abstract void nullSafeSetInternal(PreparedStatement ps, int index, Object value, LobCreator lobCreator) throws SQLException, IOException, HibernateException
Deprecated.Template method to set the given parameter value on the given statement.- Parameters:
ps
- the PreparedStatement to set onindex
- the statement parameter indexvalue
- the value to setlobCreator
- the LobCreator to use- Throws:
SQLException
- if thrown by JDBC methodsIOException
- if thrown by streaming methodsHibernateException
- in case of any other exceptions