|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.orm.hibernate3.support.AbstractLobType
org.springframework.orm.hibernate3.support.BlobSerializableType
public class BlobSerializableType
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.
LocalSessionFactoryBean.setLobHandler(org.springframework.jdbc.support.lob.LobHandler)
Field Summary |
---|
Fields inherited from class org.springframework.orm.hibernate3.support.AbstractLobType |
---|
logger |
Constructor Summary | |
---|---|
|
BlobSerializableType()
Constructor used by Hibernate: fetches config-time LobHandler and config-time JTA TransactionManager from LocalSessionFactoryBean. |
protected |
BlobSerializableType(LobHandler lobHandler,
javax.transaction.TransactionManager jtaTransactionManager)
Constructor used for testing: takes an explicit LobHandler and an explicit JTA TransactionManager (can be null ). |
Method Summary | |
---|---|
java.lang.Object |
deepCopy(java.lang.Object value)
This implementation returns the passed-in value as-is. |
boolean |
isMutable()
This implementation returns false. |
protected 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. |
protected 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.Class |
returnedClass()
|
int[] |
sqlTypes()
|
Methods inherited from class org.springframework.orm.hibernate3.support.AbstractLobType |
---|
assemble, disassemble, equals, hashCode, nullSafeGet, nullSafeSet, replace |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BlobSerializableType()
LocalSessionFactoryBean.getConfigTimeLobHandler()
,
LocalSessionFactoryBean.getConfigTimeTransactionManager()
protected BlobSerializableType(LobHandler lobHandler, javax.transaction.TransactionManager jtaTransactionManager)
null
).
Method Detail |
---|
public int[] sqlTypes()
public java.lang.Class returnedClass()
public boolean isMutable()
AbstractLobType
isMutable
in interface org.hibernate.usertype.UserType
isMutable
in class AbstractLobType
public java.lang.Object deepCopy(java.lang.Object value) throws org.hibernate.HibernateException
AbstractLobType
deepCopy
in interface org.hibernate.usertype.UserType
deepCopy
in class AbstractLobType
org.hibernate.HibernateException
protected 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, org.hibernate.HibernateException
AbstractLobType
nullSafeGetInternal
in class AbstractLobType
rs
- the ResultSet to extract fromnames
- the column namesowner
- the containing entitylobHandler
- the LobHandler to use
java.sql.SQLException
- if thrown by JDBC methods
java.io.IOException
- if thrown by streaming methods
org.hibernate.HibernateException
- in case of any other exceptionsprotected void nullSafeSetInternal(java.sql.PreparedStatement ps, int index, java.lang.Object value, LobCreator lobCreator) throws java.sql.SQLException, java.io.IOException
AbstractLobType
nullSafeSetInternal
in class AbstractLobType
ps
- the PreparedStatement to set onindex
- the statement parameter indexvalue
- the value to setlobCreator
- the LobCreator to use
java.sql.SQLException
- if thrown by JDBC methods
java.io.IOException
- if thrown by streaming methods
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |