|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object atg.cortex.PropertyList atg.cortex.ResultSetProcessor
public class ResultSetProcessor
This subclass of PropertyList is able to process ResultSets into Java Objects. The processor must be prepared with a set of Property objects that correspond to the columns expected from the ResultSet. Null Properties represent ResultSet elements that are to be ignored.
Field Summary | |
---|---|
static java.lang.String |
CLASS_VERSION
Class version string |
Constructor Summary | |
---|---|
ResultSetProcessor()
Constructs a new ResultSetProcessor |
Method Summary | |
---|---|
java.lang.Object[] |
processResultSet(java.sql.ResultSet pResultSet)
Processes the specified ResultSet and returns an array of the resulting objects. |
java.lang.Object[] |
processResultSet(java.sql.ResultSet pResultSet,
int pFirstRow,
int pMaxRows)
Processes the specified ResultSet and returns an array of the resulting objects. |
java.lang.Object |
processResultSetRow(java.sql.ResultSet pResultSet)
Processes one ResultSet row. |
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. |
java.lang.Object[] |
processResultSetRow(java.sql.ResultSet pResultSet,
java.lang.Object[] pObject)
Processes one ResultSet row by filling in the values of the specified objects, as opposed to creating new objects to hold the values. |
Methods inherited from class atg.cortex.PropertyList |
---|
addProperties, addProperty, getBeanClass, getBeanClasses, getClassProperties, getProperties, getProperty, getPropertyCount, getPropertyToClassTable |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static java.lang.String CLASS_VERSION
Constructor Detail |
---|
public ResultSetProcessor()
Method Detail |
---|
public java.lang.Object[] processResultSet(java.sql.ResultSet pResultSet) throws java.sql.SQLException
pResultSet
- the ResultSet to process
java.sql.SQLException
- if an error occurred during processingprocessResultSetRow(java.sql.ResultSet)
public java.lang.Object[] processResultSet(java.sql.ResultSet pResultSet, int pFirstRow, int pMaxRows) throws java.sql.SQLException
pResultSet
- the ResultSet to processpFirstRow
- the first row to skip to, where 0 is the first rowpMaxRows
- the maximum number of rows to return. All subsequent
rows are discarded. If -1, then there is no maximum.
java.sql.SQLException
- if an error occurred during processingprocessResultSetRow(java.sql.ResultSet)
public java.lang.Object processResultSetRow(java.sql.ResultSet pResultSet) throws java.sql.SQLException
For example, if columns 1-3 were associated with the Person class, and columns 4-5 were associated with the Payscale class, then two objects would be created, one Person and one Payscale. The appropriate result set values would be assigned to the two objects. A 2-element object array would then be created, with element 0 containing the Person and element 1 containing the Payscale. The array is then returned.
If only one class is used by all the columns, then an array of objects is not created. Instead, the object of the appropriate class is created and returned, thereby avoiding the degenerate case of having a bunch of 1-element object arrays.
pResultSet
- the ResultSet from which one row should be
processed.
java.sql.SQLException
- if an error occurred during processingprocessResultSet(java.sql.ResultSet)
public java.lang.Object processResultSetRow(java.sql.ResultSet pResultSet, java.lang.Object pObject) throws java.sql.SQLException
pResultSet
- the ResultSet from which one row should be
processed.pObject
- the object whose values are to be filled in from
the row
java.sql.SQLException
- if an error occurred during processingprocessResultSet(java.sql.ResultSet)
public java.lang.Object[] processResultSetRow(java.sql.ResultSet pResultSet, java.lang.Object[] pObject) throws java.sql.SQLException
pResultSet
- the ResultSet from which one row should be
processed.pObject
- the array of objects whose values are to be
filled in from the row
java.sql.SQLException
- if an error occurred during processingprocessResultSet(java.sql.ResultSet)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |