atg.rview
Class ResultSetProcessor

java.lang.Object
  extended by atg.rview.ResultSetProcessor

public abstract class ResultSetProcessor
extends java.lang.Object

A ResultSetProcessor will read rows from a ResultSet and convert those rows into objects by assigning column values to property values.


Field Summary
static java.lang.String CLASS_VERSION
           
 
Constructor Summary
ResultSetProcessor()
           
 
Method Summary
abstract  java.lang.Class getBeanClass()
          Returns the Class of the bean used to represent the rows returned by this ResultSetProcessor.
abstract  RelationalViewManager getRelationalViewManager()
          Returns the RelationalViewManager that produced this RelationalView.
abstract  java.lang.Object[] processResultSet(java.sql.ResultSet pResultSet)
          Processes the specified ResultSet and returns an array of the resulting objects.
abstract  java.lang.Object[] processResultSet(java.sql.ResultSet pResultSet, int pFirstRow, int pMaxRows)
          Processes the specified ResultSet and returns an array of the resulting objects.
abstract  java.lang.Object processResultSetRow(java.sql.ResultSet pResultSet)
          Processes one ResultSet row.
abstract  java.lang.Object processResultSetRow(java.sql.ResultSet pResultSet, java.lang.Object pObject)
          Processes one ResultSet row by filling in the values of the specified object, as opposed to creating a new object to hold the values.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static java.lang.String CLASS_VERSION
Constructor Detail

ResultSetProcessor

public ResultSetProcessor()
Method Detail

getRelationalViewManager

public abstract RelationalViewManager getRelationalViewManager()
Returns the RelationalViewManager that produced this RelationalView.


getBeanClass

public abstract java.lang.Class getBeanClass()
Returns the Class of the bean used to represent the rows returned by this ResultSetProcessor.


processResultSet

public abstract java.lang.Object[] processResultSet(java.sql.ResultSet pResultSet)
                                             throws java.sql.SQLException
Processes the specified ResultSet and returns an array of the resulting objects. Each object is obtained by calling processResultSetRow.

Parameters:
pResultSet - the ResultSet to process
Returns:
an array of the objects read from the rows of the ResultSet.
Throws:
java.sql.SQLException - if an error occurred during processing
See Also:
processResultSetRow(java.sql.ResultSet)

processResultSet

public abstract java.lang.Object[] processResultSet(java.sql.ResultSet pResultSet,
                                                    int pFirstRow,
                                                    int pMaxRows)
                                             throws java.sql.SQLException
Processes the specified ResultSet and returns an array of the resulting objects. Each object is obtained by calling processResultSetRow. A range of rows may be specified. Rows are skipped until the FirstRow is reached (where 0 is the first row). For example, if FirstRow is 4, then rows 0,1,2,3 are skipped. MaxRows specifies the maximum number of rows to be returned.

Parameters:
pResultSet - the ResultSet to process
pFirstRow - the first row to skip to, where 0 is the first row
pMaxRows - the maximum number of rows to return. All subsequent rows are discarded. If -1, then there is no maximum.
Returns:
an array of the objects read from the rows of the ResultSet.
Throws:
java.sql.SQLException - if an error occurred during processing
See Also:
processResultSetRow(java.sql.ResultSet)

processResultSetRow

public abstract java.lang.Object processResultSetRow(java.sql.ResultSet pResultSet)
                                              throws java.sql.SQLException
Processes one ResultSet row. This will assign the columns from the ResultSet to the appropriate properties of a new object.

Parameters:
pResultSet - the ResultSet from which one row should be processed.
Returns:
the object created from the result set
Throws:
java.sql.SQLException - if an error occurred during processing
See Also:
processResultSet(java.sql.ResultSet)

processResultSetRow

public abstract java.lang.Object processResultSetRow(java.sql.ResultSet pResultSet,
                                                     java.lang.Object pObject)
                                              throws java.sql.SQLException
Processes one ResultSet row by filling in the values of the specified object, as opposed to creating a new object to hold the values. The object is returned. If this ResultSetProcessor has a "switch" column (i.e., the type of the class depends on one of its property values), then a new object is created, even if an object is supplied.

Parameters:
pResultSet - the ResultSet from which one row should be processed.
pObject - the object whose values are to be filled in from the row. If null, then the object is created.
Returns:
pObject
Throws:
java.sql.SQLException - if an error occurred during processing
See Also:
processResultSet(java.sql.ResultSet)