org.springframework.orm.hibernate.support
Class AbstractLobType

Direct Known Subclasses:
BlobByteArrayType, BlobSerializableType, ClobStringType

public abstract class AbstractLobType
implements UserType

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.

Author:
Juergen Hoeller
Since: 1.1
See Also: LobHandler, org.springframework.orm.hibernate.LocalSessionFactoryBean.setLobHandler(org.springframework.jdbc.support.lob.LobHandler), org.springframework.orm.hibernate.LocalSessionFactoryBean.setJtaTransactionManager(javax.transaction.TransactionManager)

Method Summary
 ObjectdeepCopy(Object value)
          This implementation returns the passed-in value as-is.
 booleanequals(Object x, Object y)
          This implementation delegates to the Hibernate EqualsHelper.
 booleanisMutable()
          This implementation returns false.
 final ObjectnullSafeGet(ResultSet rs, String[] names, Object owner)
          This implementation delegates to nullSafeGetInternal, passing in the LobHandler of this type.
 final voidnullSafeSet(PreparedStatement st, Object value, int index)
          This implementation delegates to nullSafeSetInternal, passing in a transaction-synchronized LobCreator for the LobHandler of this type.

Method Detail

deepCopy

public Object deepCopy(Object value)
throws HibernateException
This implementation returns the passed-in value as-is.

equals

public boolean equals(Object x, Object y)
throws HibernateException
This implementation delegates to the Hibernate EqualsHelper.
See Also:
net.sf.hibernate.util.EqualsHelper#equals

isMutable

public boolean isMutable()
This implementation returns false.

nullSafeGet

public final Object nullSafeGet(ResultSet rs, String[] names, Object owner)
throws HibernateException,
java.sql.SQLException
This implementation delegates to nullSafeGetInternal, passing in the LobHandler of this type.
See Also:
nullSafeGetInternal(java.sql.ResultSet,int,org.springframework.jdbc.support.lob.LobHandler)

nullSafeSet

public final void nullSafeSet(PreparedStatement st, Object value, int index)
throws HibernateException,
java.sql.SQLException
This implementation delegates to nullSafeSetInternal, passing in a transaction-synchronized LobCreator for the LobHandler of this type.
See Also:
nullSafeSetInternal(java.sql.PreparedStatement,int,java.lang.Object,org.springframework.jdbc.support.lob.LobCreator)

Association Links

to Class org.springframework.jdbc.support.lob.LobHandler

to Class javax.transaction.TransactionManager