org.datanucleus.store.rdbms.request
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 |
FetchRequest(org.datanucleus.store.mapped.DatastoreClass classTable,
org.datanucleus.metadata.AbstractMemberMetaData[] mmds,
org.datanucleus.metadata.AbstractClassMetaData cmd,
org.datanucleus.ClassLoaderResolver clr)
Constructor, taking the table. |
|
Method Summary |
void |
execute(org.datanucleus.store.ObjectProvider sm)
Method to execute the request - to be implemented by deriving classes. |
protected int |
processMembersOfClass(SQLStatement sqlStatement,
org.datanucleus.metadata.AbstractMemberMetaData[] mmds,
org.datanucleus.store.mapped.DatastoreClass table,
SQLTable sqlTbl,
org.datanucleus.store.mapped.StatementClassMapping mappingDef,
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 |
FetchRequest
public FetchRequest(org.datanucleus.store.mapped.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
execute
public void execute(org.datanucleus.store.ObjectProvider sm)
- Description copied from class:
Request
- Method to execute the request - to be implemented by deriving classes.
- Specified by:
execute in class Request
- Parameters:
sm - The StateManager for the object in question.
processMembersOfClass
protected int processMembersOfClass(SQLStatement sqlStatement,
org.datanucleus.metadata.AbstractMemberMetaData[] mmds,
org.datanucleus.store.mapped.DatastoreClass table,
SQLTable sqlTbl,
org.datanucleus.store.mapped.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 selectsfetchCallbacks - Any additional required callbacks are added here
- Returns:
- Number of fields being fetched
Copyright © 2012. All Rights Reserved.