org.apache.beehive.controls.system.jdbc
Class DefaultObjectResultSetMapper

Object
  extended by ResultSetMapper
      extended by DefaultObjectResultSetMapper
Direct Known Subclasses:
DefaultXmlObjectResultSetMapper

public class DefaultObjectResultSetMapper
extends ResultSetMapper

Default ResultSetMapper implementation for Objects.


Field Summary
protected static TypeMappingsFactory _tmf
          static reference to the TypeMappingsFactory for this class
 
Constructor Summary
DefaultObjectResultSetMapper()
           
 
Method Summary
protected  Object arrayFromResultSet(ResultSet rs, int maxRows, Class arrayClass, Calendar cal)
          Invoked when the return type of the method is an array type.
 Object mapToResultType(ControlBeanContext context, Method m, ResultSet resultSet, Calendar cal)
          Map the ResultSet to the method's return type.
 
Methods inherited from class ResultSetMapper
canCloseResultSet
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_tmf

protected static final TypeMappingsFactory _tmf
static reference to the TypeMappingsFactory for this class

Constructor Detail

DefaultObjectResultSetMapper

public DefaultObjectResultSetMapper()
Method Detail

mapToResultType

public Object mapToResultType(ControlBeanContext context,
                              Method m,
                              ResultSet resultSet,
                              Calendar cal)
Map the ResultSet to the method's return type. The object type returned is defined by the return type of the method.

Specified by:
mapToResultType in class ResultSetMapper
Parameters:
context - A ControlBeanContext instance, see Beehive controls javadoc for additional information
m - Method assoicated with this call.
resultSet - Result set to map.
cal - A Calendar instance for time/date value resolution.
Returns:
The Object resulting from the ResultSet

arrayFromResultSet

protected Object arrayFromResultSet(ResultSet rs,
                                    int maxRows,
                                    Class arrayClass,
                                    Calendar cal)
                             throws SQLException
Invoked when the return type of the method is an array type.

Parameters:
rs - ResultSet to process.
maxRows - The maximum size of array to create
arrayClass - The class of object contained within the array
cal - A calendar instance to use for date/time values
Returns:
An array of the specified class type
Throws:
SQLException - On error.