public class

BlobSerializableType

extends AbstractLobType
java.lang.Object
   ↳ org.springframework.orm.hibernate3.support.AbstractLobType
     ↳ org.springframework.orm.hibernate3.support.BlobSerializableType

Class Overview

Hibernate UserType implementation for arbitrary objects that get serialized to BLOBs. Retrieves the LobHandler to use from LocalSessionFactoryBean at config time.

Can also be defined in generic Hibernate mappings, as DefaultLobCreator will work with most JDBC-compliant database drivers. In this case, the field type does not have to be BLOB: For databases like MySQL and MS SQL Server, any large enough binary type will work.

Summary

[Expand]
Inherited Fields
From class org.springframework.orm.hibernate3.support.AbstractLobType
Public Constructors
BlobSerializableType()
Constructor used by Hibernate: fetches config-time LobHandler and config-time JTA TransactionManager from LocalSessionFactoryBean.
Protected Constructors
BlobSerializableType(LobHandler lobHandler, TransactionManager jtaTransactionManager)
Constructor used for testing: takes an explicit LobHandler and an explicit JTA TransactionManager (can be null).
Public Methods
Object deepCopy(Object value)
This implementation returns the passed-in value as-is.
boolean isMutable()
This implementation returns false.
Class returnedClass()
int[] sqlTypes()
Protected Methods
Object nullSafeGetInternal(ResultSet rs, String[] names, Object owner, LobHandler lobHandler)
Template method to extract a value from the given result set.
void nullSafeSetInternal(PreparedStatement ps, int index, Object value, LobCreator lobCreator)
Template method to set the given parameter value on the given statement.
[Expand]
Inherited Methods
From class org.springframework.orm.hibernate3.support.AbstractLobType
From class java.lang.Object

Public Constructors

public BlobSerializableType ()

Constructor used by Hibernate: fetches config-time LobHandler and config-time JTA TransactionManager from LocalSessionFactoryBean.

Protected Constructors

protected BlobSerializableType (LobHandler lobHandler, TransactionManager jtaTransactionManager)

Constructor used for testing: takes an explicit LobHandler and an explicit JTA TransactionManager (can be null).

Public Methods

public Object deepCopy (Object value)

This implementation returns the passed-in value as-is.

Throws
HibernateException

public boolean isMutable ()

This implementation returns false.

public Class returnedClass ()

public int[] sqlTypes ()

Protected Methods

protected Object nullSafeGetInternal (ResultSet rs, String[] names, Object owner, LobHandler lobHandler)

Template method to extract a value from the given result set.

Parameters
rs the ResultSet to extract from
names the column names
owner the containing entity
lobHandler the LobHandler to use
Returns
  • the extracted value
Throws
HibernateException
IOException
SQLException

protected void nullSafeSetInternal (PreparedStatement ps, int index, Object value, LobCreator lobCreator)

Template method to set the given parameter value on the given statement.

Parameters
ps the PreparedStatement to set on
index the statement parameter index
value the value to set
lobCreator the LobCreator to use