Package io.dialob.api.form
Class FormRepository
java.lang.Object
org.immutables.mongo.repository.Repositories.Repository<Form>
io.dialob.api.form.FormRepository
@ParametersAreNonnullByDefault
@Generated("org.immutables.processor.ProxyProcessor")
@ThreadSafe
public class FormRepository
extends org.immutables.mongo.repository.Repositories.Repository<Form>
A
FormRepository provides type-safe access for storing and retrieving documents
from the MongoDB collection "forms".-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classFormRepository.Criteriais a Form document search query.static final classThe finder object used to proceed with find operations via theRepositories.Finder.fetchAll(),Repositories.Finder.fetchFirst(),FormRepository.Finder.andModifyFirst(), orRepositories.FinderWithDelete.deleteFirst()methods.static final classAn indexer used to create an index on the"forms"collection if it does not exist by one or more attributes.static final classstatic final classstatic final classGiventhe criteria updater describes how to perform update operations on sets of documents. -
Constructor Summary
ConstructorsConstructorDescriptionFormRepository(org.immutables.mongo.repository.RepositorySetup configuration) Constructs aFormrepository usingconfiguration. -
Method Summary
Modifier and TypeMethodDescriptioncriteria()Search criteria.find(FormRepository.Criteria criteria) Find a document by the givencriteria.Find documents by the criteria expressed as a JSON string.findAll()Finds all documents.Find documents by theididentity attribute.index()Ensure an indexon collection forms by one or more attributes using the family ofwith*()attribute-specific methods.org.immutables.mongo.concurrent.FluentFuture<Integer>Inserts a single document into the collection.org.immutables.mongo.concurrent.FluentFuture<Integer>Insert documents into the collection.update(FormRepository.Criteria criteria) Update the set of"forms"documents.org.immutables.mongo.concurrent.FluentFuture<Integer>Update or insert a document, matched by the identifier value of the 'id' attribute.Methods inherited from class org.immutables.mongo.repository.Repositories.Repository
codecRegistry, collection, doDelete, doFetch, doFindOneAndDelete, doIndex, doInsert, doModify, doReplace, doUpdate, doUpdateFirst, doUpsert, fieldNamingStrategy
-
Constructor Details
-
FormRepository
public FormRepository(org.immutables.mongo.repository.RepositorySetup configuration) Constructs aFormrepository usingconfiguration.- Parameters:
configuration- The repository configuration
-
-
Method Details
-
insert
Inserts a single document into the collection.- Parameters:
document- The form to insert- Returns:
- A future representing the number of inserted documents (1) if WriteConcern allows the insertion.
-
insert
public org.immutables.mongo.concurrent.FluentFuture<Integer> insert(Iterable<? extends Form> documents) Insert documents into the collection.- Parameters:
documents- The documents to insert- Returns:
- A future representing the number of inserted documents if WriteConcern allows the insertion.
-
findAll
Finds all documents. Use the returnedFormRepository.Finderobject to completefetch allor other operations.- Returns:
- A finder object used to complete operations
-
find
Find documents by the criteria expressed as a JSON string. Use the returnedFormRepository.Finderobject to completefetchorfetchoperations.- Parameters:
jsonCriteria- A JSON string for native criteria- Returns:
- A finder object used to complete operations
-
findById
Find documents by theididentity attribute. Use the returnedFormRepository.Finderobject to completefetchorfetchAllread operations. You can also usemodify,replaceordeleteoperations to update / delete the document.- Parameters:
id- The exactidvalue- Returns:
- A finder object used to complete operations
-
upsert
Update or insert a document, matched by the identifier value of the 'id' attribute.- Parameters:
document- The form to upsert- Returns:
- A future representing the of number of inserted documents (1) if WriteConcern allows the insertion.
-
find
Find a document by the givencriteria. Use the returnedFormRepository.Finderobject to completefetchoperations. You can also usemodifyordeleteoperations to update / delete the document(s).- Parameters:
criteria- The search criteria- Returns:
- A finder object used to complete operations
-
update
Update the set of"forms"documents.- Parameters:
criteria- The search criteria for update- Returns:
- An updater object that will be used to complete the update.
-
index
Ensure an indexon collection forms by one or more attributes using the family ofwith*()attribute-specific methods. While indexes will usually be maintained by special administration scripts, for simple cases it is convenient to ensure an index on application startup.- Returns:
- An indexer object to be completed with the
Repositories.Indexer.ensure()operation. - See Also:
-
Repositories.Indexer.named(String)Repositories.Indexer.unique()
-
criteria
Search criteria. Returns an initial object to create criteria by invoking methods that describe attribute specific constraints.- Returns:
- An empty immutable criteria
-