org.jpox.store.query
Class PersistentIDROF

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

public final class PersistentIDROF
extends java.lang.Object
implements Query.ResultObjectFactory

Class to take a JDBC ResultSet and create a PersistenceCapable object instance for each row in the ResultSet. Each row in the ResultSet represents an instance of a particular object type. We can determine the object type in one of two ways :

Version:
$Revision: 1.28 $

Field Summary
protected  AbstractClassMetaData acmd
          fieldnumbers taken from this MetaData
protected  int[] datastoreIdentityExpressionIndex
          Indices of datastore identity columns
protected  boolean discriminator
          Flag whether we should use a discriminator column to distinguish object types (otherwise use JPOXMETADATA).
protected  FetchPlanImpl fetchPlan
          Fetch Plan to use when loading fields (if any).
protected  int[] fieldNumbers
          FIeld numbers to populate.
protected  boolean hasMetaDataInResults
          if the results have included a meta data column with the class name
protected  StatementExpressionIndex[] statementExpressionIndex
          Mapping from ResultSet to field numbers and mappings.
protected  int[] versionIndex
          Index of version column(s).
 
Constructor Summary
PersistentIDROF(DatastoreClass table, int[] fieldNumbers, AbstractClassMetaData acmd, StatementExpressionIndex[] statementExpressionIndex, int[] datastoreIdentityExpressionIndex, int[] versionIndex, boolean ignoreCache, boolean discriminator, boolean hasMetaDataInResults, FetchPlanImpl fetchPlan)
          Constructor.
 
Method Summary
 java.lang.Object getObject(PersistenceManager pm, java.sql.ResultSet rs, java.lang.Class pcClass)
          Method to convert the current ResultSet row into an Object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fieldNumbers

protected int[] fieldNumbers
FIeld numbers to populate.


statementExpressionIndex

protected StatementExpressionIndex[] statementExpressionIndex
Mapping from ResultSet to field numbers and mappings.


datastoreIdentityExpressionIndex

protected final int[] datastoreIdentityExpressionIndex
Indices of datastore identity columns


versionIndex

protected final int[] versionIndex
Index of version column(s).


discriminator

protected boolean discriminator
Flag whether we should use a discriminator column to distinguish object types (otherwise use JPOXMETADATA).


hasMetaDataInResults

protected final boolean hasMetaDataInResults
if the results have included a meta data column with the class name


fetchPlan

protected final FetchPlanImpl fetchPlan
Fetch Plan to use when loading fields (if any).


acmd

protected final AbstractClassMetaData acmd
fieldnumbers taken from this MetaData

Constructor Detail

PersistentIDROF

public PersistentIDROF(DatastoreClass table,
                       int[] fieldNumbers,
                       AbstractClassMetaData acmd,
                       StatementExpressionIndex[] statementExpressionIndex,
                       int[] datastoreIdentityExpressionIndex,
                       int[] versionIndex,
                       boolean ignoreCache,
                       boolean discriminator,
                       boolean hasMetaDataInResults,
                       FetchPlanImpl fetchPlan)
Constructor.

Parameters:
table - Table being selected from
fieldNumbers - Numbers of the fields in the select. May be null if no fields are retrieved
statementExpressionIndex - Index of columns to statement columns
datastoreIdentityExpressionIndex - index for datastore identity
versionIndex - Indices of the version column(s)
ignoreCache - Whether to ignore the cache
discriminator - Whether we use a discriminator column to distinguish object types, or whether we use a JPOXMETADATA column
hasMetaDataInResults - whether we use JPOXMETADATA column
fetchPlan - the Fetch Plan
Method Detail

getObject

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

Specified by:
getObject in interface Query.ResultObjectFactory
Parameters:
pm - The PersistenceManager
rs - The ResultSet from the Query.
pcClass - The candidate class that we are looking for (may be base class).
Returns:
The (persisted) object.


Copyright © -2007 . All Rights Reserved.