com.ge.grc.acuity.actions.mapping
Class RowAsXMapForSP

java.lang.Object
  extended bycom.ge.grc.acuity.actions.mapping.RowAsXMapForSP
All Implemented Interfaces:
StoredProcedureMappingFunction

public class RowAsXMapForSP
extends java.lang.Object
implements StoredProcedureMappingFunction

Implements a mapping function for stored procedure calls. Calls the RowAsXMap.process(java.sql.ResultSet, java.util.Map) method with a ResultSet returned from a stored procedure call.

Version:
$Revision: 1.2 $ $Date: 2006/09/08 22:40:23 $
Author:
garbiras

Constructor Summary
RowAsXMapForSP()
          Calls the default constructor with argument 0
RowAsXMapForSP(int index)
          Default constructor.
 
Method Summary
 int getResultSetIndex()
          Returns the index of the array of stored procedure return values to extract as a ResultSet
 boolean hasDataseriesOutput()
          Returns true if the return value from the StoredProcedureMappingFunction.process(java.lang.Object[], java.util.Map) method contains data suitable for constructing a dataseries.
 boolean hasTableOutput()
          Returns true if the return value from the StoredProcedureMappingFunction.process(java.lang.Object[], java.util.Map) method contains data suitable for constructing a table.
 java.util.List[] process(java.lang.Object[] returnVals, java.util.Map parameters)
          Processes a the return values of a stored procedure call according to the parameters specified in the argument Map
 void setResultSetIndex(int index)
          Sets the index of the array of stored procedure return values to extract as a ResultSet
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RowAsXMapForSP

public RowAsXMapForSP()
Calls the default constructor with argument 0

See Also:
RowAsXMapForSP(int)

RowAsXMapForSP

public RowAsXMapForSP(int index)
Default constructor. Sets the index value to use to extract a ResultSet from the array of stored procedure return values.

Parameters:
index - the index of the array of stored procedure return values to extract as a ResultSet
See Also:
setResultSetIndex(int)
Method Detail

getResultSetIndex

public int getResultSetIndex()
Returns the index of the array of stored procedure return values to extract as a ResultSet

Returns:
The array index which holds the ResultSet to process

hasDataseriesOutput

public final boolean hasDataseriesOutput()
Description copied from interface: StoredProcedureMappingFunction
Returns true if the return value from the StoredProcedureMappingFunction.process(java.lang.Object[], java.util.Map) method contains data suitable for constructing a dataseries. The first element of the array would be a list of names of the dataseries. Each subsequent element of the returned array would represent a dataseries. The List preserves the order of the data, and each element of the List would contain Map objects. The Map would contain attribute keys such as xMin, xMax, yMin, yMax, xMinLabel, xMaxLabel, yMinLabel, yMaxLabel

Specified by:
hasDataseriesOutput in interface StoredProcedureMappingFunction
Returns:
true if the return value of the StoredProcedureMappingFunction#process(java.lang.Object[], java.util.Map) method contains dataseries information; false otherwise.

hasTableOutput

public final boolean hasTableOutput()
Description copied from interface: StoredProcedureMappingFunction
Returns true if the return value from the StoredProcedureMappingFunction.process(java.lang.Object[], java.util.Map) method contains data suitable for constructing a table. The first element of the array would be a list of column headings of the data table. Each subsequent element of the returned array would represent a table row. Within each table row would be a list representing each column of that row. Within each column would be an object array, with the zero-index element being the data for that row-column pair, and the one-index element being the decorator to apply to that row-column pair.

Specified by:
hasTableOutput in interface StoredProcedureMappingFunction
Returns:
true if the return value of the StoredProcedureMappingFunction#process(java.lang.Object[], java.util.Map) method contains table information; false otherwise.

process

public java.util.List[] process(java.lang.Object[] returnVals,
                                java.util.Map parameters)
Description copied from interface: StoredProcedureMappingFunction
Processes a the return values of a stored procedure call according to the parameters specified in the argument Map

Specified by:
process in interface StoredProcedureMappingFunction
Parameters:
returnVals - the array of returned parameters from a stored procedure. If any ResultSets are returned as non-output parameters, they are added to the beginning of the array, in the order in which they are served up. The array elements are ordered according to the stored procedure call that obtained them
parameters - the mapping parameters by which to manipulate the returned values
Returns:
an array of List objects containing the mapped elements of the processed data. The details of the List contents are described by the ResultSetMappingFunction.hasDataseriesOutput() and ResultSetMappingFunction.hasTableOutput() methods.
See Also:
ResultSetMappingFunction.hasDataseriesOutput(), ResultSetMappingFunction.hasTableOutput()

setResultSetIndex

public void setResultSetIndex(int index)
Sets the index of the array of stored procedure return values to extract as a ResultSet

Parameters:
index - the index of the array of stored procedure return values which holds the ResultSet to process