public class

BlobByteArrayTypeHandler

extends AbstractLobTypeHandler
java.lang.Object
   ↳ BaseTypeHandler
     ↳ org.springframework.orm.ibatis.support.AbstractLobTypeHandler
       ↳ org.springframework.orm.ibatis.support.BlobByteArrayTypeHandler

Class Overview

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.

Summary

[Expand]
Inherited Constants
From class org.springframework.orm.ibatis.support.AbstractLobTypeHandler
Public Constructors
BlobByteArrayTypeHandler()
Constructor used by iBATIS: fetches config-time LobHandler from SqlMapClientFactoryBean.
Protected Constructors
BlobByteArrayTypeHandler(LobHandler lobHandler)
Constructor used for testing: takes an explicit LobHandler.
Public Methods
Object valueOf(String s)
Protected Methods
Object getResultInternal(ResultSet rs, int index, LobHandler lobHandler)
Template method to extract a value from the given result set.
void setParameterInternal(PreparedStatement ps, int index, Object value, String jdbcType, LobCreator lobCreator)
Template method to set the given value on the given statement.
[Expand]
Inherited Methods
From class org.springframework.orm.ibatis.support.AbstractLobTypeHandler
From class java.lang.Object

Public Constructors

public BlobByteArrayTypeHandler ()

Constructor used by iBATIS: fetches config-time LobHandler from SqlMapClientFactoryBean.

Protected Constructors

protected BlobByteArrayTypeHandler (LobHandler lobHandler)

Constructor used for testing: takes an explicit LobHandler.

Public Methods

public Object valueOf (String s)

Protected Methods

protected Object getResultInternal (ResultSet rs, int index, LobHandler lobHandler)

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

Parameters
rs the ResultSet to extract from
index the index in the ResultSet
lobHandler the LobHandler to use
Returns
  • the extracted value
Throws
SQLException

protected void setParameterInternal (PreparedStatement ps, int index, Object value, String jdbcType, LobCreator lobCreator)

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

Parameters
ps the PreparedStatement to set on
index the statement parameter index
value the parameter value to set
jdbcType the JDBC type of the parameter
lobCreator the LobCreator to use
Throws
SQLException