|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.orm.hibernate.support.AbstractLobType org.springframework.orm.hibernate.support.BlobByteArrayType
Hibernate UserType implementation for byte arrays that get mapped 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 databases respectively 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.
LobHandler
,
LocalSessionFactoryBean.setLobHandler(org.springframework.jdbc.support.lob.LobHandler)
Field Summary |
Fields inherited from class org.springframework.orm.hibernate.support.AbstractLobType |
logger |
Constructor Summary | |
|
BlobByteArrayType()
Constructor used by Hibernate: fetches config-time LobHandler and config-time JTA TransactionManager from LocalSessionFactoryBean. |
protected |
BlobByteArrayType(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 |
equals(java.lang.Object x,
java.lang.Object y)
This implementation delegates to the Hibernate EqualsHelper. |
boolean |
isMutable()
This implementation returns false. |
protected java.lang.Object |
nullSafeGetInternal(java.sql.ResultSet rs,
int index,
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 value on the given statement. |
java.lang.Class |
returnedClass()
|
int[] |
sqlTypes()
|
Methods inherited from class org.springframework.orm.hibernate.support.AbstractLobType |
nullSafeGet, nullSafeSet |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public BlobByteArrayType()
LocalSessionFactoryBean.getConfigTimeLobHandler()
,
LocalSessionFactoryBean.getConfigTimeTransactionManager()
protected BlobByteArrayType(LobHandler lobHandler, javax.transaction.TransactionManager jtaTransactionManager)
Method Detail |
public int[] sqlTypes()
public java.lang.Class returnedClass()
public boolean isMutable()
AbstractLobType
isMutable
in interface net.sf.hibernate.UserType
isMutable
in class AbstractLobType
public boolean equals(java.lang.Object x, java.lang.Object y)
AbstractLobType
equals
in interface net.sf.hibernate.UserType
equals
in class AbstractLobType
EqualsHelper.equals(java.lang.Object, java.lang.Object)
public java.lang.Object deepCopy(java.lang.Object value)
AbstractLobType
deepCopy
in interface net.sf.hibernate.UserType
deepCopy
in class AbstractLobType
protected java.lang.Object nullSafeGetInternal(java.sql.ResultSet rs, int index, LobHandler lobHandler) throws java.sql.SQLException
AbstractLobType
nullSafeGetInternal
in class AbstractLobType
rs
- the ResultSet to extract fromindex
- the index in the ResultSetlobHandler
- the LobHandler to use
java.sql.SQLException
- if thrown by JDBC methodsprotected void nullSafeSetInternal(java.sql.PreparedStatement ps, int index, java.lang.Object value, LobCreator lobCreator) throws java.sql.SQLException
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
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |