sf logo

sf.qof.adapter
Class ClobAdapter

java.lang.Object
  extended by sf.qof.adapter.ClobAdapter
All Implemented Interfaces:
GeneratorMappingAdapter, MappingAdapter

public class ClobAdapter
extends Object
implements GeneratorMappingAdapter

ClobAdapter is a generator mapping adapter for SQL Clob data types.

It maps Clob columns to String and vice versa.

See Also:
Clob

Constructor Summary
ClobAdapter()
           
 
Method Summary
 void generateFromResult(ResultMapping resultMapping, net.sf.cglib.core.CodeEmitter co, net.sf.cglib.core.Local result, int[] indexes)
          Method to map the current record of a result set or the result of a callable statement to an object on the stack.
 void generateFromResultSet(ResultMapping resultMapping, net.sf.cglib.core.CodeEmitter co, net.sf.cglib.core.Local resultSet, String[] columns)
          Method to map the current record of a result set to an object on the stack.
 void generateRegisterOutputParameters(ResultMapping resultMapping, net.sf.cglib.core.CodeEmitter co, net.sf.cglib.core.Local callableStatement, int[] indexes)
          Method to register an output parameter in a callable statement.
 void generateToPreparedStatement(ParameterMapping parameterMapping, net.sf.cglib.core.CodeEmitter co, net.sf.cglib.core.Local preparedStatement, int[] indexes, net.sf.cglib.core.Local indexOffset)
          Method to map the object on top of the stack to a prepared statement.
 int getNumberOfColumns()
          Returns the number of mapped columns.
 Set<Class<?>> getTypes()
          Returns the set of mappable Java types.
static void register()
          Register the mapping adapter with the default name "clob".
static void register(String typeName)
          Register the mapping adapter with the specified name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClobAdapter

public ClobAdapter()
Method Detail

generateFromResult

public void generateFromResult(ResultMapping resultMapping,
                               net.sf.cglib.core.CodeEmitter co,
                               net.sf.cglib.core.Local result,
                               int[] indexes)
Description copied from interface: GeneratorMappingAdapter
Method to map the current record of a result set or the result of a callable statement to an object on the stack. indexes defines the SQL indexes for the result set to be used in functions such a getInt(index).

Specified by:
generateFromResult in interface GeneratorMappingAdapter
Parameters:
resultMapping - the result mapping
co - code emitter
result - ResultSet or CallableStatement local variable
indexes - array of SQL indexes

generateFromResultSet

public void generateFromResultSet(ResultMapping resultMapping,
                                  net.sf.cglib.core.CodeEmitter co,
                                  net.sf.cglib.core.Local resultSet,
                                  String[] columns)
Description copied from interface: GeneratorMappingAdapter
Method to map the current record of a result set to an object on the stack. columns defines the SQL column name for the result set to be used in functions such a getInt(name).

Specified by:
generateFromResultSet in interface GeneratorMappingAdapter
Parameters:
resultMapping - the result mapping
co - code emitter
resultSet - ResultSet local variable
columns - array of SQL column names

generateToPreparedStatement

public void generateToPreparedStatement(ParameterMapping parameterMapping,
                                        net.sf.cglib.core.CodeEmitter co,
                                        net.sf.cglib.core.Local preparedStatement,
                                        int[] indexes,
                                        net.sf.cglib.core.Local indexOffset)
Description copied from interface: GeneratorMappingAdapter
Method to map the object on top of the stack to a prepared statement. indexes defines the SQL index for the prepared statement to be used in functions such a setInt(index, value).

Specified by:
generateToPreparedStatement in interface GeneratorMappingAdapter
Parameters:
parameterMapping - the parameter mapping
co - code emitter
preparedStatement - prepared statement local variable
indexes - array of SQL indexes
indexOffset - offset to be added to the indexes if not null

generateRegisterOutputParameters

public void generateRegisterOutputParameters(ResultMapping resultMapping,
                                             net.sf.cglib.core.CodeEmitter co,
                                             net.sf.cglib.core.Local callableStatement,
                                             int[] indexes)
Description copied from interface: GeneratorMappingAdapter
Method to register an output parameter in a callable statement.

Specified by:
generateRegisterOutputParameters in interface GeneratorMappingAdapter
Parameters:
resultMapping - the result mapping
co - code emitter
callableStatement - callable statement local variable
indexes - array of SQL indexes

getNumberOfColumns

public int getNumberOfColumns()
Description copied from interface: MappingAdapter
Returns the number of mapped columns.

Specified by:
getNumberOfColumns in interface MappingAdapter
Returns:
number of mapped columns

getTypes

public Set<Class<?>> getTypes()
Description copied from interface: MappingAdapter
Returns the set of mappable Java types.

Specified by:
getTypes in interface MappingAdapter
Returns:
a set of mappable Java types

register

public static void register()
Register the mapping adapter with the default name "clob".


register

public static void register(String typeName)
Register the mapping adapter with the specified name.

Parameters:
typeName - type name

sf logo

Copyright © 2007 brunella ltd. All Rights Reserved.