Spring Data JDBC Extensions Support

org.springframework.data.jdbc.support.oracle
Class SqlStructValue

java.lang.Object
  extended by org.springframework.jdbc.core.support.AbstractSqlTypeValue
      extended by org.springframework.data.jdbc.support.oracle.SqlStructValue
All Implemented Interfaces:
SqlTypeValue

public class SqlStructValue
extends AbstractSqlTypeValue

Implementation of the SqlTypeValue interface, for convenient creation of type values that to be provided as a STRUCT.

A usage example from a StoredProcedure:

proc.declareParameter(new SqlParameter("actor", OracleTypes.STRUCT, "ACTOR_TYPE"));
 ...

 Map in = new HashMap();
 in.put("myarray", new SqlArrayValue(actor);
 Map out = proc.execute(in);
 

Since:
1.0
Author:
Thomas Risberg
See Also:
SqlTypeValue, AbstractSqlTypeValue, SimpleJdbcCall, StoredProcedure

Field Summary
protected  org.apache.commons.logging.Log logger
          Logger available to subclasses
 
Fields inherited from interface org.springframework.jdbc.core.SqlTypeValue
TYPE_UNKNOWN
 
Constructor Summary
SqlStructValue(Object source)
          Constructor that takes one parameter with the array of values passed in to the stored procedure.
 
Method Summary
protected  Object createTypeValue(Connection conn, int sqlType, String typeName)
          The implementation for this specific type.
 
Methods inherited from class org.springframework.jdbc.core.support.AbstractSqlTypeValue
setTypeValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected final org.apache.commons.logging.Log logger
Logger available to subclasses

Constructor Detail

SqlStructValue

public SqlStructValue(Object source)
Constructor that takes one parameter with the array of values passed in to the stored procedure.

Parameters:
source - the Object containing the values to be mapped to the STRUCT.
Method Detail

createTypeValue

protected Object createTypeValue(Connection conn,
                                 int sqlType,
                                 String typeName)
                          throws SQLException
The implementation for this specific type. This method is called internally by the Spring Framework during the out parameter processing and it's not accessed by application code directly.

Specified by:
createTypeValue in class AbstractSqlTypeValue
Throws:
SQLException
See Also:
AbstractSqlTypeValue

Spring Data JDBC Extensions Support

Copyright © 2011. All Rights Reserved.