Class FetchRequest2

  extended by
      extended by

public class FetchRequest2
extends Request

Class to retrieve the fields of an object of a specified class from the datastore. If some of those fields are themselves persistent objects then this can optionally retrieve fields of those objects in the same fetch.

Any surrogate version stored in this table will be fetched *if* the object being updated doesn't already have a value for it. If the caller wants the surrogate version to be updated then they should nullify the "transactional" version before calling.

Field Summary
Fields inherited from class
key, LOCALISER, table
Constructor Summary
FetchRequest2( classTable, org.datanucleus.metadata.AbstractMemberMetaData[] mmds, java.lang.Class cls, org.datanucleus.ClassLoaderResolver clr)
          Constructor, taking the table.
Method Summary
 void execute(org.datanucleus.StateManager sm)
          Method to execute the request - to be implemented by deriving classes.
protected  int processMembersOfClass(SQLStatement sqlStatement, java.lang.Class cls, org.datanucleus.metadata.AbstractMemberMetaData[] mmds, table, SQLTable sqlTbl, mappingDef, java.util.Collection fetchCallbacks, org.datanucleus.ClassLoaderResolver clr)
          Method to process the supplied members of the class, adding to the SQLStatement as required.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


public FetchRequest2( classTable,
                     org.datanucleus.metadata.AbstractMemberMetaData[] mmds,
                     java.lang.Class cls,
                     org.datanucleus.ClassLoaderResolver clr)
Constructor, taking the table. Uses the structure of the datastore table to build a basic query.

classTable - The Class Table representing the datastore table to retrieve
mmds - MetaData of the fields/properties to retrieve
cls - Class of objects being fetched
clr - ClassLoader resolver
Method Detail


public void execute(org.datanucleus.StateManager sm)
Description copied from class: Request
Method to execute the request - to be implemented by deriving classes.

Specified by:
execute in class Request
sm - The StateManager for the object in question.


protected int processMembersOfClass(SQLStatement sqlStatement,
                                    java.lang.Class cls,
                                    org.datanucleus.metadata.AbstractMemberMetaData[] mmds,
                                    SQLTable sqlTbl,
                                    java.util.Collection fetchCallbacks,
                                    org.datanucleus.ClassLoaderResolver clr)
Method to process the supplied members of the class, adding to the SQLStatement as required. Can recurse if some of the requested fields are persistent objects in their own right, so we take the opportunity to retrieve some of their fields.

sqlStatement - Statement being built
cls - The class
mmds - Meta-data for the required fields/properties
table - The table to look for member mappings
sqlTbl - The table in the SQL statement to use for selects
fetchCallbacks - Any additional required callbacks are added here
Number of fields being fetched

Copyright © 2009. All Rights Reserved.