org.datanucleus.store.rdbms.request
Class InsertRequest
java.lang.Object
org.datanucleus.store.rdbms.request.Request
org.datanucleus.store.rdbms.request.InsertRequest
public class InsertRequest
- extends Request
Class to provide a means of insertion of records to a data store. Extends basic request class
implementing the execute method to do a JDBC insert operation.
When inserting an object with inheritance this will involve 1 InsertRequest
for each table involved. So if we have a class B that extends class A and they
both use "new-table" inheritance strategy, we will have 2 InsertRequests, one for
table A, and one for table B.
When the InsertRequest starts to populate its statement and it has a PC field, this calls
PersistenceCapableMapping.setObject(). This then checks if the other PC object is yet persistent
and, if not, will persist it before processing this objects INSERT. This forms the key to
"persistence-by-reachability".
|
Constructor Summary |
InsertRequest(org.datanucleus.store.mapped.DatastoreClass table,
org.datanucleus.metadata.AbstractClassMetaData cmd,
org.datanucleus.ClassLoaderResolver clr)
Constructor, taking the table. |
|
Method Summary |
void |
execute(org.datanucleus.store.ObjectProvider op)
Method performing the insertion of the record from the datastore. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
InsertRequest
public InsertRequest(org.datanucleus.store.mapped.DatastoreClass table,
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:
table - The Class Table representing the datastore table to insert.cmd - ClassMetaData for the object being persistedclr - ClassLoader resolver
execute
public void execute(org.datanucleus.store.ObjectProvider op)
- Method performing the insertion of the record from the datastore.
Takes the constructed insert query and populates with the specific record information.
- Specified by:
execute in class Request
- Parameters:
op - The ObjectProvider for the record to be inserted
Copyright © 2012. All Rights Reserved.