Search in sources :

Example 1 with UpdateRequest

use of org.datanucleus.store.rdbms.request.UpdateRequest in project datanucleus-rdbms by datanucleus.

the class RDBMSPersistenceHandler method getUpdateRequest.

/**
 * Returns a request object that will update a row in the given table.
 * The store manager will cache the request object for re-use by subsequent requests to the same table.
 * @param table The table in which to update.
 * @param mmds The metadata corresponding to the columns to be updated.
 *     MetaData whose columns exist in supertables will be ignored.
 * @param cmd ClassMetaData of the object of the request
 * @param clr ClassLoader resolver
 * @return An update request object.
 */
private Request getUpdateRequest(DatastoreClass table, AbstractMemberMetaData[] mmds, AbstractClassMetaData cmd, ClassLoaderResolver clr) {
    RequestIdentifier reqID = new RequestIdentifier(table, mmds, RequestType.UPDATE, cmd.getFullClassName());
    Request req = requestsByID.get(reqID);
    if (req == null) {
        req = new UpdateRequest(table, mmds, cmd, clr);
        requestsByID.put(reqID, req);
    }
    return req;
}
Also used : UpdateRequest(org.datanucleus.store.rdbms.request.UpdateRequest) LocateRequest(org.datanucleus.store.rdbms.request.LocateRequest) Request(org.datanucleus.store.rdbms.request.Request) FetchRequest(org.datanucleus.store.rdbms.request.FetchRequest) DeleteRequest(org.datanucleus.store.rdbms.request.DeleteRequest) InsertRequest(org.datanucleus.store.rdbms.request.InsertRequest) LocateBulkRequest(org.datanucleus.store.rdbms.request.LocateBulkRequest) UpdateRequest(org.datanucleus.store.rdbms.request.UpdateRequest) RequestIdentifier(org.datanucleus.store.rdbms.request.RequestIdentifier)

Aggregations

DeleteRequest (org.datanucleus.store.rdbms.request.DeleteRequest)1 FetchRequest (org.datanucleus.store.rdbms.request.FetchRequest)1 InsertRequest (org.datanucleus.store.rdbms.request.InsertRequest)1 LocateBulkRequest (org.datanucleus.store.rdbms.request.LocateBulkRequest)1 LocateRequest (org.datanucleus.store.rdbms.request.LocateRequest)1 Request (org.datanucleus.store.rdbms.request.Request)1 RequestIdentifier (org.datanucleus.store.rdbms.request.RequestIdentifier)1 UpdateRequest (org.datanucleus.store.rdbms.request.UpdateRequest)1