org.jpox.store.query
Class ResultClassROF

java.lang.Object
  extended byorg.jpox.store.query.ResultClassROF
All Implemented Interfaces:
Query.ResultObjectFactory

public class ResultClassROF
extends java.lang.Object
implements Query.ResultObjectFactory

Take a ResultSet, and for each row retrieves an object of a specified type. Follows the rules in JDO2 spec [14.6.12] regarding the result class.

The resultClass will be used to create objects of that type when calling getObject(). The resultClass can be one of the following

Objects of this class are created in 2 distinct situations. The first is where a candidate class is available, and consequently field position mappings are available. The second is where no candidate class is available and so only the field names are available, and the results are taken in ResultSet order. These 2 modes have their own constructor.

Version:
$Revision: 1.20 $

Field Summary
protected static Localiser LOCALISER
           
 
Constructor Summary
ResultClassROF(java.lang.Class resultClass, StatementExpressionIndex[] statementExpressionIndex)
          Constructor for cases where we have a candidate class and so have mapping information to base field positions on.
ResultClassROF(java.lang.Class resultClass, StatementExpressionIndex[] statementExpressionIndex, ScalarExpression[] expressions)
          Constructor for cases where we have a candidate class and so have mapping information to base field positions on.
ResultClassROF(java.lang.Class resultClass, java.lang.String[] resultFieldNames)
          Constructor for cases where we have no candidate class and so have no mapping information to base field positions on.
 
Method Summary
 java.lang.Object getObject(PersistenceManager pm, java.sql.ResultSet rs, java.lang.Class pcClass)
          Method to convert the ResultSet row into an Object of the ResultClass type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOCALISER

protected static final Localiser LOCALISER
Constructor Detail

ResultClassROF

public ResultClassROF(java.lang.Class resultClass,
                      StatementExpressionIndex[] statementExpressionIndex)
Constructor for cases where we have a candidate class and so have mapping information to base field positions on.

Parameters:
resultClass - The result class to use
statementExpressionIndex - The mapping information for field positions etc

ResultClassROF

public ResultClassROF(java.lang.Class resultClass,
                      StatementExpressionIndex[] statementExpressionIndex,
                      ScalarExpression[] expressions)
Constructor for cases where we have a candidate class and so have mapping information to base field positions on.

Parameters:
resultClass - The result class to use
statementExpressionIndex - The mapping information for field positions etc
expressions - The result expressions (if known)

ResultClassROF

public ResultClassROF(java.lang.Class resultClass,
                      java.lang.String[] resultFieldNames)
Constructor for cases where we have no candidate class and so have no mapping information to base field positions on. The fields will be retrieved in the ResultSet order.

Parameters:
resultClass - The result class to use
resultFieldNames - Names for the result fields
Method Detail

getObject

public java.lang.Object getObject(PersistenceManager pm,
                                  java.sql.ResultSet rs,
                                  java.lang.Class pcClass)
Method to convert the ResultSet row into an Object of the ResultClass type.

Specified by:
getObject in interface Query.ResultObjectFactory
Parameters:
pm - The PersistenceManager
rs - The ResultSet from the Query.
pcClass - Not used.
Returns:
The ResultClass object.


Copyright © -2007 . All Rights Reserved.