DocSaver.Op| Constructor and Description |
|---|
BasicDocSaver(Translator translator,
com.redhat.lightblue.eval.FieldAccessRoleEvaluator roleEval)
Creates a doc saver with the given translator and role evaluator
|
| Modifier and Type | Method and Description |
|---|---|
void |
saveDoc(com.redhat.lightblue.crud.CRUDOperationContext ctx,
DocSaver.Op op,
boolean upsert,
com.mongodb.DBCollection collection,
com.redhat.lightblue.metadata.EntityMetadata md,
com.mongodb.DBObject dbObject,
com.redhat.lightblue.crud.DocCtx inputDoc)
Inserts or saves a doc
|
public BasicDocSaver(Translator translator, com.redhat.lightblue.eval.FieldAccessRoleEvaluator roleEval)
public void saveDoc(com.redhat.lightblue.crud.CRUDOperationContext ctx,
DocSaver.Op op,
boolean upsert,
com.mongodb.DBCollection collection,
com.redhat.lightblue.metadata.EntityMetadata md,
com.mongodb.DBObject dbObject,
com.redhat.lightblue.crud.DocCtx inputDoc)
DocSaversaveDoc in interface DocSaverctx - Operation contextop - insert or saveupsert - Whether to insert if the document is not in dbcollection - The MongoDB collection to which documents will be
inserted or savedmd - Entity metadatadbObject - Document to insert/saveinputDoc - The input document
The implementation should insert or save the document to the collection.
If operation is insert, the document is inserted, and the _id is returned
in the output document of inputDoc. If the operation is save, and the
document to be saved has _id, the document is attempted to be updated in
the db. If the db does not have the document but upsert=true, document is
inserted. Otherwise, update fails.Copyright © 2014. All rights reserved.