Class FetchRequest
- java.lang.Object
-
- org.datanucleus.store.rdbms.request.Request
-
- org.datanucleus.store.rdbms.request.FetchRequest
-
public class FetchRequest 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.
-
-
Constructor Summary
Constructors Constructor Description FetchRequest(DatastoreClass classTable, org.datanucleus.metadata.AbstractMemberMetaData[] mmds, org.datanucleus.metadata.AbstractClassMetaData cmd, org.datanucleus.ClassLoaderResolver clr)
Constructor, taking the table.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
execute(org.datanucleus.state.ObjectProvider op)
Method to execute the request - to be implemented by deriving classes.protected int
processMembersOfClass(SelectStatement sqlStatement, org.datanucleus.metadata.AbstractMemberMetaData[] mmds, DatastoreClass table, SQLTable sqlTbl, StatementClassMapping mappingDef, Collection fetchCallbacks, org.datanucleus.ClassLoaderResolver clr)
Method to process the supplied members of the class, adding to the SQLStatement as required.
-
-
-
Constructor Detail
-
FetchRequest
public FetchRequest(DatastoreClass classTable, org.datanucleus.metadata.AbstractMemberMetaData[] mmds, org.datanucleus.metadata.AbstractClassMetaData cmd, org.datanucleus.ClassLoaderResolver clr)
Constructor, taking the table. Uses the structure of the datastore table to build a basic query.- Parameters:
classTable
- The Class Table representing the datastore table to retrievemmds
- MetaData of the fields/properties to retrievecmd
- ClassMetaData of objects being fetchedclr
- ClassLoader resolver
-
-
Method Detail
-
execute
public void execute(org.datanucleus.state.ObjectProvider op)
Description copied from class:Request
Method to execute the request - to be implemented by deriving classes.
-
processMembersOfClass
protected int processMembersOfClass(SelectStatement sqlStatement, org.datanucleus.metadata.AbstractMemberMetaData[] mmds, DatastoreClass table, SQLTable sqlTbl, StatementClassMapping mappingDef, 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.- Parameters:
sqlStatement
- Statement being builtmmds
- Meta-data for the required fields/propertiestable
- The table to look for member mappingssqlTbl
- The table in the SQL statement to use for selectsmappingDef
- Mapping definition for the resultfetchCallbacks
- Any additional required callbacks are added hereclr
- ClassLoader resolver- Returns:
- Number of fields being fetched
-
-