public abstract class AbstractDocumentTemplateAsync extends Object implements DocumentTemplateAsync
DocumentTemplateAsync interface,
to minimize the effort required to implement this interface.| Constructor and Description |
|---|
AbstractDocumentTemplateAsync() |
| 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.
|
protected abstract ClassRepresentations |
getClassRepresentations() |
protected abstract DocumentEntityConverter |
getConverter() |
protected abstract Converters |
getConverters() |
protected abstract org.jnosql.diana.api.document.DocumentCollectionManagerAsync |
getManager() |
<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
|
<T> void |
singleResult(String query,
Consumer<Optional<T>> callback)
Executes a query then bring the result as a unique result
|
<T> void |
update(T entity)
Updates an entity asynchronously
|
<T> void |
update(T entity,
Consumer<T> callBack)
Updates an entity asynchronously
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitinsert, insert, singleResult, updateprotected abstract DocumentEntityConverter getConverter()
protected abstract org.jnosql.diana.api.document.DocumentCollectionManagerAsync getManager()
protected abstract ClassRepresentations getClassRepresentations()
protected abstract Converters getConverters()
public <T> void insert(T entity)
DocumentTemplateAsyncinsert in interface DocumentTemplateAsyncT - the instance typeentity - entity to be savedpublic <T> void insert(T entity,
Duration ttl)
DocumentTemplateAsyncinsert in interface DocumentTemplateAsyncT - the instance typeentity - entity to be savedttl - the time to livepublic <T> void insert(T entity,
Consumer<T> callBack)
DocumentTemplateAsyncinsert in interface DocumentTemplateAsyncT - the instance typeentity - entity to be savedcallBack - the callback, when the process is finished will call this instance returning
the saved entity within parameterspublic <T> void insert(T entity,
Duration ttl,
Consumer<T> callBack)
DocumentTemplateAsyncinsert in interface DocumentTemplateAsyncT - 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 parameterspublic <T> void update(T entity)
DocumentTemplateAsyncupdate in interface DocumentTemplateAsyncT - the instance typeentity - entity to be updatedpublic <T> void update(T entity,
Consumer<T> callBack)
DocumentTemplateAsyncupdate in interface DocumentTemplateAsyncT - the instance typeentity - entity to be updatedcallBack - the callback, when the process is finished will call this instance returning
the updated entity within parametersapublic void delete(org.jnosql.diana.api.document.DocumentDeleteQuery query)
DocumentTemplateAsyncdelete in interface DocumentTemplateAsyncquery - query to delete an entitypublic void delete(org.jnosql.diana.api.document.DocumentDeleteQuery query,
Consumer<Void> callback)
DocumentTemplateAsyncdelete in interface DocumentTemplateAsyncquery - query to delete an entitycallback - the callback, when the process is finished will call this instance returning
the null within parameterspublic <T> void select(org.jnosql.diana.api.document.DocumentQuery query,
Consumer<List<T>> callback)
DocumentTemplateAsyncselect in interface DocumentTemplateAsyncT - the instance typequery - query to select entitiescallback - the callback, when the process is finished will call this instance returning
the result of query within parameterspublic <T,ID> void find(Class<T> entityClass, ID id, Consumer<Optional<T>> callBack)
DocumentTemplateAsyncfind in interface DocumentTemplateAsyncT - the entity class typeID - the id typeentityClass - the entity classid - the id valuecallBack - the callBackpublic <T,ID> void delete(Class<T> entityClass, ID id, Consumer<Void> callBack)
DocumentTemplateAsyncdelete in interface DocumentTemplateAsyncT - the entity class typeID - the id typeentityClass - the entity classid - the id valuecallBack - the callBackpublic <T,ID> void delete(Class<T> entityClass, ID id)
DocumentTemplateAsyncdelete in interface DocumentTemplateAsyncT - the entity class typeID - the id typeentityClass - the entity classid - the id valuepublic <T> void query(String query, Consumer<List<T>> callback)
DocumentTemplateAsyncListquery in interface DocumentTemplateAsyncT - the entity typequery - the querycallback - the callback, when the process is finished will call this instance returningpublic <T> void singleResult(String query, Consumer<Optional<T>> callback)
DocumentTemplateAsyncsingleResult in interface DocumentTemplateAsyncT - the entity typequery - the querycallback - the callback, when the process is finished will call this instance returningpublic PreparedStatementAsync prepare(String query)
DocumentTemplateAsyncPreparedStatementAsync from the queryprepare in interface DocumentTemplateAsyncquery - the queryPreparedStatementAsync instancepublic void count(String documentCollection, Consumer<Long> callback)
DocumentTemplateAsynccount in interface DocumentTemplateAsyncdocumentCollection - the document collectioncallback - the callback with the responsepublic <T> void count(Class<T> entityClass, Consumer<Long> callback)
DocumentTemplateAsynccount in interface DocumentTemplateAsyncT - the entity typeentityClass - the document collectioncallback - the callback with the responseCopyright © 2018. All rights reserved.