public interface DocumentTemplateAsync
DocumentCollectionManagerAsync| Modifier and Type | Method and Description |
|---|---|
<T> void |
count(Class<T> entityClass,
Consumer<Long> callback)
Returns the number of elements from document collection
|
void |
count(String documentCollection,
Consumer<Long> callback)
Returns the number of elements from document collection
|
<T,ID> void |
delete(Class<T> entityClass,
ID id)
Deletes by Id.
|
<T,ID> void |
delete(Class<T> entityClass,
ID id,
Consumer<Void> callBack)
Deletes by Id.
|
void |
delete(org.jnosql.diana.api.document.DocumentDeleteQuery query)
Deletes an entity asynchronously
|
void |
delete(org.jnosql.diana.api.document.DocumentDeleteQuery query,
Consumer<Void> callback)
Deletes an entity asynchronously
|
<T,ID> void |
find(Class<T> entityClass,
ID id,
Consumer<Optional<T>> callBack)
Finds by Id.
|
default <T> void |
insert(Iterable<T> entities)
Saves entities asynchronously, by default it's just run for each saving using
insert(Object),
each NoSQL vendor might replace to a more appropriate one. |
default <T> void |
insert(Iterable<T> entities,
Duration ttl)
Saves entities asynchronously with time to live, by default it's just run for each saving using
insert(Object) (Object, Duration)},
each NoSQL vendor might replace to a more appropriate one. |
<T> void |
insert(T entity)
Saves an entity asynchronously
|
<T> void |
insert(T entity,
Consumer<T> callBack)
Saves an entity asynchronously
|
<T> void |
insert(T entity,
Duration ttl)
Saves an entity asynchronously with time to live
|
<T> void |
insert(T entity,
Duration ttl,
Consumer<T> callBack)
Saves an entity asynchronously with time to live
|
PreparedStatementAsync |
prepare(String query)
Creates a
PreparedStatementAsync from the query |
<T> void |
query(String query,
Consumer<List<T>> callback)
Executes a query then bring the result as a
List |
<T> void |
select(org.jnosql.diana.api.document.DocumentQuery query,
Consumer<List<T>> callback)
Finds entities from query asynchronously
|
default <T> void |
singleResult(org.jnosql.diana.api.document.DocumentQuery query,
Consumer<Optional<T>> callBack)
Execute a query to consume an unique result
|
<T> void |
singleResult(String query,
Consumer<Optional<T>> callback)
Executes a query then bring the result as a unique result
|
default <T> void |
update(Iterable<T> entities)
Updates entities asynchronously, by default it's just run for each saving using
DocumentTemplate.update(Object),
each NoSQL vendor might replace to a more appropriate one. |
<T> void |
update(T entity)
Updates an entity asynchronously
|
<T> void |
update(T entity,
Consumer<T> callBack)
Updates an entity asynchronously
|
<T> void insert(T entity)
T - the instance typeentity - entity to be savedorg.jnosql.diana.api.ExecuteAsyncQueryException - when there is a async errorUnsupportedOperationException - when the database does not have support to insert asynchronousNullPointerException - when entity are null<T> void insert(T entity,
Duration ttl)
T - the instance typeentity - entity to be savedttl - the time to liveorg.jnosql.diana.api.ExecuteAsyncQueryException - when there is a async errorUnsupportedOperationException - when the database does not have support to insert asynchronousNullPointerException - when either entity or ttl are nulldefault <T> void insert(Iterable<T> entities)
insert(Object),
each NoSQL vendor might replace to a more appropriate one.T - the instance typeentities - entities to be savedorg.jnosql.diana.api.ExecuteAsyncQueryException - when there is a async errorUnsupportedOperationException - when the database does not have support to insert asynchronousNullPointerException - when entities is nulldefault <T> void insert(Iterable<T> entities, Duration ttl)
insert(Object) (Object, Duration)},
each NoSQL vendor might replace to a more appropriate one.T - the instance typeentities - entities to be savedttl - time to liveorg.jnosql.diana.api.ExecuteAsyncQueryException - when there is a async errorUnsupportedOperationException - when the database does not have support to insert asynchronousNullPointerException - when either entities or ttl are null<T> void insert(T entity,
Consumer<T> callBack)
T - the instance typeentity - entity to be savedcallBack - the callback, when the process is finished will call this instance returning
the saved entity within parametersorg.jnosql.diana.api.ExecuteAsyncQueryException - when there is a async errorUnsupportedOperationException - when the database does not have support to insert asynchronousNullPointerException - when either entity or callBack are null<T> void insert(T entity,
Duration ttl,
Consumer<T> callBack)
T - the instance typeentity - entity to be savedttl - time to livecallBack - the callback, when the process is finished will call this instance returning
the saved entity within parametersorg.jnosql.diana.api.ExecuteAsyncQueryException - when there is a async errorUnsupportedOperationException - when the database does not have support to insert asynchronousNullPointerException - when either entity or ttl or callBack are null<T> void update(T entity,
Consumer<T> callBack)
T - the instance typeentity - entity to be updatedcallBack - the callback, when the process is finished will call this instance returning
the updated entity within parametersaorg.jnosql.diana.api.ExecuteAsyncQueryException - when there is a async errorUnsupportedOperationException - when the database does not have support to insert asynchronousNullPointerException - when either entity or callback are null<T> void update(T entity)
T - the instance typeentity - entity to be updatedorg.jnosql.diana.api.ExecuteAsyncQueryException - when there is a async errorUnsupportedOperationException - when the database does not have support to insert asynchronousNullPointerException - when entity is nulldefault <T> void update(Iterable<T> entities)
DocumentTemplate.update(Object),
each NoSQL vendor might replace to a more appropriate one.T - the instance typeentities - entities to be savedorg.jnosql.diana.api.ExecuteAsyncQueryException - when there is a async errorUnsupportedOperationException - when the database does not have support to insert asynchronousNullPointerException - when entities is nullvoid delete(org.jnosql.diana.api.document.DocumentDeleteQuery query)
query - query to delete an entityorg.jnosql.diana.api.ExecuteAsyncQueryException - when there is a async errorUnsupportedOperationException - when the database does not have support to insert asynchronousNullPointerException - when query is nullvoid delete(org.jnosql.diana.api.document.DocumentDeleteQuery query,
Consumer<Void> callback)
query - query to delete an entitycallback - the callback, when the process is finished will call this instance returning
the null within parametersorg.jnosql.diana.api.ExecuteAsyncQueryException - when there is a async errorUnsupportedOperationException - when the database does not have support to delete asynchronousNullPointerException - when either query or callback are null<T> void select(org.jnosql.diana.api.document.DocumentQuery query,
Consumer<List<T>> callback)
T - the instance typequery - query to select entitiescallback - the callback, when the process is finished will call this instance returning
the result of query within parametersorg.jnosql.diana.api.ExecuteAsyncQueryException - when there is a async errorUnsupportedOperationException - when the database does not have support to insert asynchronousNullPointerException - when either query or callback are null<T> void query(String query, Consumer<List<T>> callback)
ListT - the entity typecallback - the callback, when the process is finished will call this instance returningquery - the queryNullPointerException - when the query is null<T> void singleResult(String query, Consumer<Optional<T>> callback)
T - the entity typecallback - the callback, when the process is finished will call this instance returningquery - the queryNullPointerException - when the query is nullorg.jnosql.diana.api.NonUniqueResultException - if returns more than one resultPreparedStatementAsync prepare(String query)
PreparedStatementAsync from the queryquery - the queryPreparedStatementAsync instanceNullPointerException - when the query is null<T,ID> void find(Class<T> entityClass, ID id, Consumer<Optional<T>> callBack)
T - the entity class typeID - the id typeentityClass - the entity classid - the id valuecallBack - the callBackNullPointerException - when either the entityClass or id are nullIdNotFoundException - when the entityClass does not have the Id annotation<T,ID> void delete(Class<T> entityClass, ID id, Consumer<Void> callBack)
T - the entity class typeID - the id typeentityClass - the entity classid - the id valuecallBack - the callBackNullPointerException - when either the entityClass or id are nullIdNotFoundException - when the entityClass does not have the Id annotation<T,ID> void delete(Class<T> entityClass, ID id)
T - the entity class typeID - the id typeentityClass - the entity classid - the id valueNullPointerException - when either the entityClass or id are nullIdNotFoundException - when the entityClass does not have the Id annotationvoid count(String documentCollection, Consumer<Long> callback)
documentCollection - the document collectioncallback - the callback with the responseNullPointerException - when there is null parameterUnsupportedOperationException - when the database dot not have support<T> void count(Class<T> entityClass, Consumer<Long> callback)
T - the entity typeentityClass - the document collectioncallback - the callback with the responseNullPointerException - when there is null parameterUnsupportedOperationException - when the database dot not have supportdefault <T> void singleResult(org.jnosql.diana.api.document.DocumentQuery query,
Consumer<Optional<T>> callBack)
T - the typequery - the querycallBack - the callbackorg.jnosql.diana.api.ExecuteAsyncQueryException - when there is a async errorUnsupportedOperationException - when the database does not have support to insert asynchronousNullPointerException - when either query or callback are nullorg.jnosql.diana.api.NonUniqueResultException - when it returns more than one resultCopyright © 2018. All rights reserved.