org.springframework.orm.ibatis.support
Class BlobByteArrayTypeHandler
java.lang.Object
com.ibatis.sqlmap.engine.type.BaseTypeHandler
org.springframework.orm.ibatis.support.AbstractLobTypeHandler
org.springframework.orm.ibatis.support.BlobByteArrayTypeHandler
- All Implemented Interfaces:
- com.ibatis.sqlmap.engine.type.TypeHandler
public class BlobByteArrayTypeHandler
- extends AbstractLobTypeHandler
iBATIS TypeHandler implementation for byte arrays that get mapped to BLOBs.
Retrieves the LobHandler to use from SqlMapClientFactoryBean at config time.
Can also be defined in generic iBATIS 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.
- Since:
- 1.1.5
- Author:
- Juergen Hoeller
- See Also:
SqlMapClientFactoryBean.setLobHandler(org.springframework.jdbc.support.lob.LobHandler)
Methods inherited from class com.ibatis.sqlmap.engine.type.BaseTypeHandler |
equals |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BlobByteArrayTypeHandler
public BlobByteArrayTypeHandler()
- Constructor used by iBATIS: fetches config-time LobHandler from
SqlMapClientFactoryBean.
- See Also:
SqlMapClientFactoryBean.getConfigTimeLobHandler()
BlobByteArrayTypeHandler
protected BlobByteArrayTypeHandler(LobHandler lobHandler)
- Constructor used for testing: takes an explicit LobHandler.
setParameterInternal
protected void setParameterInternal(PreparedStatement ps,
int index,
Object value,
String jdbcType,
LobCreator lobCreator)
throws SQLException
- Description copied from class:
AbstractLobTypeHandler
- Template method to set the given value on the given statement.
- Specified by:
setParameterInternal
in class AbstractLobTypeHandler
- Parameters:
ps
- the PreparedStatement to set onindex
- the statement parameter indexvalue
- the parameter value to setjdbcType
- the JDBC type of the parameterlobCreator
- the LobCreator to use
- Throws:
SQLException
- if thrown by JDBC methods
getResultInternal
protected Object getResultInternal(ResultSet rs,
int index,
LobHandler lobHandler)
throws SQLException
- Description copied from class:
AbstractLobTypeHandler
- Template method to extract a value from the given result set.
- Specified by:
getResultInternal
in class AbstractLobTypeHandler
- Parameters:
rs
- the ResultSet to extract fromindex
- the index in the ResultSetlobHandler
- the LobHandler to use
- Returns:
- the extracted value
- Throws:
SQLException
- if thrown by JDBC methods
valueOf
public Object valueOf(String s)