Spring Data JDBC Extensions

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

java.lang.Object
  extended by org.springframework.data.jdbc.support.oracle.SqlReturnStruct
All Implemented Interfaces:
SqlReturnType

public class SqlReturnStruct
extends Object
implements SqlReturnType

Implementation of the SqlReturnType interface, for convenient access of object data returned from stored procedure. The target class specified in the constructor must implement java.sql.SQLData.

A usage example from a StoredProcedure:

proc.declareParameter(new SqlOutParameter("return", OracleTypes.STRUCT, "ACTOR_TYPE",
         new SqlReturnArray()));
 

Since:
1.0
Author:
Thomas Risberg
See Also:
SqlReturnType, SimpleJdbcCall, StoredProcedure

Field Summary
protected  org.apache.commons.logging.Log logger
          Logger available to subclasses
 
Fields inherited from interface org.springframework.jdbc.core.SqlReturnType
TYPE_UNKNOWN
 
Constructor Summary
SqlReturnStruct(Class<?> targetClass)
          Constructor that takes one parameter with the class that the retrieved data should be mapped into.
SqlReturnStruct(StructMapper<?> mapper)
          Constructor that takes one parameter with the StructMapper to be used.
 
Method Summary
 Object getTypeValue(CallableStatement cs, int paramIndex, int sqlType, String typeName)
          The implementation for this specific type.
 
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

SqlReturnStruct

public SqlReturnStruct(Class<?> targetClass)
Constructor that takes one parameter with the class that the retrieved data should be mapped into.

Parameters:
targetClass - JavaBean class that STRUCT attributes will be mapped into

SqlReturnStruct

public SqlReturnStruct(StructMapper<?> mapper)
Constructor that takes one parameter with the StructMapper to be used.

Parameters:
mapper - the mapper
Method Detail

getTypeValue

public Object getTypeValue(CallableStatement cs,
                           int paramIndex,
                           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 appplication code directly.

Specified by:
getTypeValue in interface SqlReturnType
Throws:
SQLException

Spring Data JDBC Extensions