public interface DocumentTemplate extends Template
DocumentCollectionManagerDocumentCollectionManager| Modifier and Type | Method and Description |
|---|---|
<T> long |
count(Class<T> entityType)
Returns the number of elements from document collection
|
long |
count(String documentCollection)
Returns the number of elements from document collection
|
void |
delete(DocumentDeleteQuery query)
Deletes an entity
|
PreparedStatement |
prepare(String query)
Creates a
PreparedStatement from the query |
<T> Stream<T> |
query(String query)
Executes a query then bring the result as a
Stream |
<T> Stream<T> |
select(DocumentQuery query)
Finds entities from query
|
<T> Page<T> |
select(DocumentQueryPagination query)
Finds entities from query using pagination
|
<T> Optional<T> |
singleResult(DocumentQuery query)
Returns a single entity from query
|
<T> Optional<T> |
singleResult(String query)
Executes a query then bring the result as a unique result
|
void delete(DocumentDeleteQuery query)
query - query to delete an entityNullPointerException - query is null<T> Stream<T> select(DocumentQuery query)
T - the instance typequery - - query to figure out entitiesNullPointerException - when query is null<T> Page<T> select(DocumentQueryPagination query)
T - the instance typequery - - query to figure out entitiesNullPointerException - when query is nulllong count(String documentCollection)
documentCollection - the document collectionNullPointerException - when document collection is nullUnsupportedOperationException - when the database dot not have support<T> long count(Class<T> entityType)
T - entityTypeentityType - the document collectionNullPointerException - when document collection is nullUnsupportedOperationException - when the database dot not have support<T> Optional<T> singleResult(DocumentQuery query)
T - the instance typequery - - query to figure out entitiesOptional or Optional.empty() when the result is not found.jakarta.nosql.NonUniqueResultException - when the result has more than 1 entityNullPointerException - when query is null<T> Stream<T> query(String query)
StreamT - the entity typequery - the queryStreamNullPointerException - when the query is nullUnsupportedOperationException - if the specified template does not support this operation<T> Optional<T> singleResult(String query)
T - the entity typequery - the queryOptionalNullPointerException - when the query is nulljakarta.nosql.NonUniqueResultException - if returns more than one resultUnsupportedOperationException - if the specified template does not support this operationPreparedStatement prepare(String query)
PreparedStatement from the queryquery - the queryPreparedStatement instanceNullPointerException - when the query is nullUnsupportedOperationException - if the specified template does not support this operationCopyright © 2017–2022 Eclipse Foundation. All rights reserved.