public class

ClobStringTypeHandler

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

Class Overview

iBATIS TypeHandler implementation for Strings that get mapped to CLOBs. Retrieves the LobHandler to use from SqlMapClientFactoryBean at config time.

Particularly useful for storing Strings with more than 4000 characters in an Oracle database (only possible via CLOBs), in combination with OracleLobHandler.

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
ClobStringTypeHandler()
Constructor used by iBATIS: fetches config-time LobHandler from SqlMapClientFactoryBean.
Protected Constructors
ClobStringTypeHandler(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 ClobStringTypeHandler ()

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

Protected Constructors

protected ClobStringTypeHandler (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