public interface DocumentCollectionManager extends AutoCloseable
DocumentEntity
The DocumentCollectionManager API is used to create and remove persistent DocumentEntity instances,
to select entities by their primary key, and to select over entities.| Modifier and Type | Method and Description |
|---|---|
void |
close()
closes a resource
|
long |
count(String documentCollection)
Returns the number of elements from document collection
|
void |
delete(DocumentDeleteQuery query)
Deletes an entity
|
DocumentEntity |
insert(DocumentEntity entity)
Saves document collection entity
|
DocumentEntity |
insert(DocumentEntity entity,
Duration ttl)
Saves document collection entity with time to live
|
Iterable<DocumentEntity> |
insert(Iterable<DocumentEntity> entities)
Saves documents collection entity, by default it's just run for each saving using
insert(DocumentEntity),
each NoSQL vendor might replace to a more appropriate one. |
Iterable<DocumentEntity> |
insert(Iterable<DocumentEntity> entities,
Duration ttl)
Saves documents collection entity with time to live, by default it's just run for each saving using
insert(DocumentEntity, Duration),
each NoSQL vendor might replace to a more appropriate one. |
default DocumentPreparedStatement |
prepare(String query)
Executes a query and returns the result, when the operations are insert, update and select
command it will return the result of the operation when the command is delete it will return an empty collection.
|
default Stream<DocumentEntity> |
query(String query)
Executes a query and returns the result, when the operations are insert, update and select
command it will return the result of the operation when the command is delete it will return an empty collection.
|
Stream<DocumentEntity> |
select(DocumentQuery query)
Finds
DocumentEntity from select |
default Optional<DocumentEntity> |
singleResult(DocumentQuery query)
Returns a single entity from select
|
DocumentEntity |
update(DocumentEntity entity)
Updates a entity
|
Iterable<DocumentEntity> |
update(Iterable<DocumentEntity> entities)
Updates documents collection entity, by default it's just run for each saving using
update(DocumentEntity),
each NoSQL vendor might replace to a more appropriate one. |
DocumentEntity insert(DocumentEntity entity)
entity - entity to be savedNullPointerException - when document is nullDocumentEntity insert(DocumentEntity entity, Duration ttl)
entity - entity to be savedttl - the time to liveNullPointerException - when either entity or ttl are nullUnsupportedOperationException - when the database does not support this featureIterable<DocumentEntity> insert(Iterable<DocumentEntity> entities)
insert(DocumentEntity),
each NoSQL vendor might replace to a more appropriate one.entities - entities to be savedNullPointerException - when entities is nullIterable<DocumentEntity> insert(Iterable<DocumentEntity> entities, Duration ttl)
insert(DocumentEntity, Duration),
each NoSQL vendor might replace to a more appropriate one.entities - entities to be savedttl - time to liveNullPointerException - when entities is nullUnsupportedOperationException - when the database does not support this featureDocumentEntity update(DocumentEntity entity)
entity - entity to be updatedNullPointerException - when entity is nullIterable<DocumentEntity> update(Iterable<DocumentEntity> entities)
update(DocumentEntity),
each NoSQL vendor might replace to a more appropriate one.entities - entities to be savedNullPointerException - when entities is nullvoid delete(DocumentDeleteQuery query)
query - select to delete an entityNullPointerException - when select is nullUnsupportedOperationException - if the implementation does not support any operation that a query has.Stream<DocumentEntity> select(DocumentQuery query)
DocumentEntity from selectquery - - select to figure out entitiesNullPointerException - when select is nullUnsupportedOperationException - if the implementation does not support any operation that a query has.default Stream<DocumentEntity> query(String query)
query - the query as StringNullPointerException - when there is parameter nullIllegalArgumentException - when the query has value parametersIllegalStateException - when there is not DocumentQueryParserQueryException - when there is error in the syntaxdefault DocumentPreparedStatement prepare(String query)
query - the query as StringDocumentPreparedStatement instanceNullPointerException - when there is parameter nullIllegalStateException - when there is not DocumentQueryParserQueryException - when there is error in the syntaxdefault Optional<DocumentEntity> singleResult(DocumentQuery query)
query - - select to figure out entitiesOptional or Optional.empty() when the result is not found.NonUniqueResultException - when the result has more than 1 entityNullPointerException - when select is nullUnsupportedOperationException - if the implementation does not support any operation that a query has.long count(String documentCollection)
documentCollection - the document collectionNullPointerException - when document collection is nullUnsupportedOperationException - when the database dot not have supportvoid close()
close in interface AutoCloseableCopyright © 2017–2020 Eclipse Foundation. All rights reserved.