public interface CRUDController
| Modifier and Type | Method and Description |
|---|---|
CRUDDeleteResponse |
delete(CRUDOperationContext ctx,
QueryExpression query)
Deletes documents matching the search criteria
|
CRUDFindResponse |
find(CRUDOperationContext ctx,
QueryExpression query,
Projection projection,
Sort sort,
Long from,
Long to)
Searches for documents
|
MetadataListener |
getMetadataListener()
Return an implementation of MetadataListener interface to receive
notifications about metadata operations.
|
CRUDInsertionResponse |
insert(CRUDOperationContext ctx,
Projection projection)
Performs insertion of documents to the back end
|
CRUDSaveResponse |
save(CRUDOperationContext ctx,
boolean upsert,
Projection projection)
Performs update or insertion of documents to the back end
|
CRUDUpdateResponse |
update(CRUDOperationContext ctx,
QueryExpression query,
UpdateExpression update,
Projection projection)
Updates documents matching the search criteria
|
void |
updatePredefinedFields(CRUDOperationContext ctx,
JsonDoc doc)
The back end should update the predefined fields of the document
|
CRUDInsertionResponse insert(CRUDOperationContext ctx, Projection projection)
ctx - Operation contextprojection - If non-null, the inserted documents are projected using
this projection and returned in the response
The ctx must provide access to the correct versions of metadata used to
insert all the documents. All documents must be of the same entity type.
If projection is non-null, the data must be projected and returned,
otherwise, no data is returned.CRUDSaveResponse save(CRUDOperationContext ctx, boolean upsert, Projection projection)
ctx - Operation contextupsert - If true, and if a document does not exist, it is insertedprojection - If non-null, the inserted/updated documents are
projected using this projection and returned in the response
The ctx must provide access to the correct versions of metadata used to
insert/update all the documents. All documents must be of the same entity
type. If a document has nonnull _id field, the document is updated in the
db. Otherwise, if upsert is true, the document is updated. If projection
is non-null, the data must be projected and returned, otherwise, no data
is returned.CRUDUpdateResponse update(CRUDOperationContext ctx, QueryExpression query, UpdateExpression update, Projection projection)
ctx - Operation contextquery - The query specifying the documents to updateupdate - The update expression specifying the operations to be
performed on matching documentsprojection - The fields to be returned from the updated documents
If projection is non-null, the updated documents are projected and
returned.CRUDDeleteResponse delete(CRUDOperationContext ctx, QueryExpression query)
ctx - Operation contextquery - The query specifying the documents to deleteCRUDFindResponse find(CRUDOperationContext ctx, QueryExpression query, Projection projection, Sort sort, Long from, Long to)
ctx - Operation contextentity - The entity to search forquery - The query. Cannot be nullprojection - What fields to return. Cannot be nullsort - Sort keys. Can be nullfrom - starting index in the result set. Can be null. Meaninguful
only if a sort is given. Starts from 0.to - end index in the result set. Starts from 0, and inclusive. Can
be null.MetadataListener getMetadataListener()
void updatePredefinedFields(CRUDOperationContext ctx, JsonDoc doc)
Copyright © 2016. All rights reserved.