Interface ArangoOperations
- All Known Implementing Classes:
ArangoTemplate
public interface ArangoOperations
Interface that specifies a basic set of ArangoDB operations.
- Author:
- Mark Vollmary
-
Method Summary
Modifier and TypeMethodDescriptioncollection
(Class<?> entityClass) Returns the operations interface for a collection.collection
(String name) Returns the operations interface for a collection.collection
(String name, com.arangodb.model.CollectionCreateOptions options) Returns the operations interface for a collection.<T> com.arangodb.entity.DocumentDeleteEntity<T>
Deletes the document with the givenid
from a collection.com.arangodb.entity.DocumentDeleteEntity<?>
Deletes the document with the givenid
from a collection.<T> com.arangodb.entity.MultiDocumentEntity<com.arangodb.entity.DocumentDeleteEntity<T>>
deleteAll
(Iterable<?> values, com.arangodb.model.DocumentDeleteOptions options, Class<T> entityClass) Deletes multiple documents from a collection.com.arangodb.entity.MultiDocumentEntity<com.arangodb.entity.DocumentDeleteEntity<?>>
Deletes multiple documents from a collection.com.arangodb.ArangoDB
driver()
Give direct access to the underlying drivervoid
Drop an existing databaseboolean
Checks whether the document exists by reading a single document head<T> Optional<T>
Retrieves the document with the givenid
from a collection.<T> Optional<T>
Retrieves the document with the givenid
from a collection.<T> Iterable<T>
Retrieves all documents from a collection.<T> Iterable<T>
Retrieves multiple documents with the givenids
from a collection.Iterable<com.arangodb.entity.UserEntity>
getUsers()
Fetches data about all users.com.arangodb.entity.ArangoDBVersion
Returns the server name and version number.com.arangodb.entity.DocumentCreateEntity<?>
Creates a new document from the given document, unless there is already a document with the _key given.<T> com.arangodb.entity.DocumentCreateEntity<T>
insert
(T value, com.arangodb.model.DocumentCreateOptions options) Creates a new document from the given document, unless there is already a document with the _key given.<T> com.arangodb.entity.MultiDocumentEntity<com.arangodb.entity.DocumentCreateEntity<T>>
insertAll
(Iterable<? extends T> values, com.arangodb.model.DocumentCreateOptions options, Class<T> entityClass) Creates new documents from the given documents, unless there is already a document with the _key given.<T> com.arangodb.entity.MultiDocumentEntity<com.arangodb.entity.DocumentCreateEntity<?>>
Creates new documents from the given documents, unless there is already a document with the _key given.<T> com.arangodb.ArangoCursor<T>
Performs a database query using the givenquery
, then returns a newArangoCursor
instance for the result list.<T> com.arangodb.ArangoCursor<T>
Performs a database query using the givenquery
, then returns a newArangoCursor
instance for the result list.<T> com.arangodb.ArangoCursor<T>
query
(String query, Map<String, Object> bindVars, com.arangodb.model.AqlQueryOptions options, Class<T> entityClass) Performs a database query using the givenquery
andbindVars
, then returns a newArangoCursor
instance for the result list.<T> com.arangodb.ArangoCursor<T>
Performs a database query using the givenquery
andbindVars
, then returns a newArangoCursor
instance for the result list.com.arangodb.entity.DocumentUpdateEntity<?>
Replaces the document withid
with the one in the body, provided there is such a document and no precondition is violated<T> com.arangodb.entity.DocumentUpdateEntity<T>
Replaces the document withid
with the one in the body, provided there is such a document and no precondition is violated<T> com.arangodb.entity.MultiDocumentEntity<com.arangodb.entity.DocumentUpdateEntity<T>>
replaceAll
(Iterable<? extends T> values, com.arangodb.model.DocumentReplaceOptions options, Class<T> entityClass) Replaces multiple documents in the specified collection with the ones in the values, the replaced documents are specified by the _key attributes in the documents in values.<T> com.arangodb.entity.MultiDocumentEntity<com.arangodb.entity.DocumentUpdateEntity<?>>
replaceAll
(Iterable<? extends T> values, Class<T> entityClass) Replaces multiple documents in the specified collection with the ones in the values, the replaced documents are specified by the _key attributes in the documents in values.<T> T
repsert
(T value) Creates a new document from the given document, unless there is already a document with the id given.<T> Iterable<T>
repsertAll
(Iterable<T> values, Class<? super T> entityClass) Creates new documents from the given documents, unless there already exists.com.arangodb.entity.DocumentUpdateEntity<?>
Partially updates the document identified by document id or key.<T> com.arangodb.entity.DocumentUpdateEntity<T>
Partially updates the document identified by document id or key.<T> com.arangodb.entity.MultiDocumentEntity<com.arangodb.entity.DocumentUpdateEntity<T>>
updateAll
(Iterable<? extends T> values, com.arangodb.model.DocumentUpdateOptions options, Class<T> entityClass) Partially updates documents, the documents to update are specified by the _key attributes in the objects on values.<T> com.arangodb.entity.MultiDocumentEntity<com.arangodb.entity.DocumentUpdateEntity<?>>
Partially updates documents, the documents to update are specified by the _key attributes in the objects on values.Return the operations interface for a user.
-
Method Details
-
driver
com.arangodb.ArangoDB driver()Give direct access to the underlying driver- Returns:
- main access object of the driver
-
getVersion
Returns the server name and version number.- Returns:
- the server version, number
- Throws:
DataAccessException
-
query
<T> com.arangodb.ArangoCursor<T> query(String query, Map<String, Object> bindVars, com.arangodb.model.AqlQueryOptions options, Class<T> entityClass) throws DataAccessExceptionPerforms a database query using the givenquery
andbindVars
, then returns a newArangoCursor
instance for the result list.- Parameters:
query
- An AQL query stringbindVars
- key/value pairs defining the variables to bind the query tooptions
- Additional options that will be passed to the query API, can be nullentityClass
- The entity type of the result- Returns:
- cursor of the results
- Throws:
DataAccessException
-
query
<T> com.arangodb.ArangoCursor<T> query(String query, Map<String, Object> bindVars, Class<T> entityClass) throws DataAccessExceptionPerforms a database query using the givenquery
andbindVars
, then returns a newArangoCursor
instance for the result list.- Parameters:
query
- An AQL query stringbindVars
- key/value pairs defining the variables to bind the query toentityClass
- The entity type of the result- Returns:
- cursor of the results
- Throws:
DataAccessException
-
query
<T> com.arangodb.ArangoCursor<T> query(String query, com.arangodb.model.AqlQueryOptions options, Class<T> entityClass) throws DataAccessException Performs a database query using the givenquery
, then returns a newArangoCursor
instance for the result list.- Parameters:
query
- An AQL query stringoptions
- Additional options that will be passed to the query API, can be nullentityClass
- The entity type of the result- Returns:
- cursor of the results
- Throws:
DataAccessException
-
query
<T> com.arangodb.ArangoCursor<T> query(String query, Class<T> entityClass) throws DataAccessException Performs a database query using the givenquery
, then returns a newArangoCursor
instance for the result list.- Parameters:
query
- An AQL query stringentityClass
- The entity type of the result- Returns:
- cursor of the results
- Throws:
DataAccessException
-
deleteAll
<T> com.arangodb.entity.MultiDocumentEntity<com.arangodb.entity.DocumentDeleteEntity<T>> deleteAll(Iterable<?> values, com.arangodb.model.DocumentDeleteOptions options, Class<T> entityClass) throws DataAccessException Deletes multiple documents from a collection.- Parameters:
values
- The keys of the documents or the documents themselvesentityClass
- The entity class which represents the collectionoptions
- Additional options, can be null- Returns:
- information about the documents
- Throws:
DataAccessException
-
deleteAll
com.arangodb.entity.MultiDocumentEntity<com.arangodb.entity.DocumentDeleteEntity<?>> deleteAll(Iterable<?> values, Class<?> entityClass) throws DataAccessException Deletes multiple documents from a collection.- Parameters:
values
- The keys of the documents or the documents themselvesentityClass
- The entity class which represents the collection- Returns:
- information about the documents
- Throws:
DataAccessException
-
delete
<T> com.arangodb.entity.DocumentDeleteEntity<T> delete(Object id, com.arangodb.model.DocumentDeleteOptions options, Class<T> entityClass) throws DataAccessException Deletes the document with the givenid
from a collection.- Parameters:
id
- The id or key of the documententityClass
- The entity class which represents the collectionoptions
- Additional options, can be null- Returns:
- information about the document
- Throws:
DataAccessException
-
delete
com.arangodb.entity.DocumentDeleteEntity<?> delete(Object id, Class<?> entityClass) throws DataAccessException Deletes the document with the givenid
from a collection.- Parameters:
id
- The id or key of the documententityClass
- The entity class which represents the collection- Returns:
- information about the document
- Throws:
DataAccessException
-
updateAll
<T> com.arangodb.entity.MultiDocumentEntity<com.arangodb.entity.DocumentUpdateEntity<T>> updateAll(Iterable<? extends T> values, com.arangodb.model.DocumentUpdateOptions options, Class<T> entityClass) throws DataAccessException Partially updates documents, the documents to update are specified by the _key attributes in the objects on values. Vales must contain a list of document updates with the attributes to patch (the patch documents). All attributes from the patch documents will be added to the existing documents if they do not yet exist, and overwritten in the existing documents if they do exist there.- Type Parameters:
T
-- Parameters:
values
- A list of documentsentityClass
- The entity class which represents the collectionoptions
- Additional options, can be null- Returns:
- information about the documents
- Throws:
DataAccessException
-
updateAll
<T> com.arangodb.entity.MultiDocumentEntity<com.arangodb.entity.DocumentUpdateEntity<?>> updateAll(Iterable<? extends T> values, Class<T> entityClass) throws DataAccessException Partially updates documents, the documents to update are specified by the _key attributes in the objects on values. Vales must contain a list of document updates with the attributes to patch (the patch documents). All attributes from the patch documents will be added to the existing documents if they do not yet exist, and overwritten in the existing documents if they do exist there.- Type Parameters:
T
-- Parameters:
values
- A list of documentsentityClass
- The entity class which represents the collection- Returns:
- information about the documents
- Throws:
DataAccessException
-
update
<T> com.arangodb.entity.DocumentUpdateEntity<T> update(Object id, T value, com.arangodb.model.DocumentUpdateOptions options) throws DataAccessException Partially updates the document identified by document id or key. The value must contain a document with the attributes to patch (the patch document). All attributes from the patch document will be added to the existing document if they do not yet exist, and overwritten in the existing document if they do exist there.- Parameters:
id
- The id or key of the documentvalue
- A representation of a single documentoptions
- Additional options, can be null- Returns:
- information about the document
- Throws:
DataAccessException
-
update
com.arangodb.entity.DocumentUpdateEntity<?> update(Object id, Object value) throws DataAccessException Partially updates the document identified by document id or key. The value must contain a document with the attributes to patch (the patch document). All attributes from the patch document will be added to the existing document if they do not yet exist, and overwritten in the existing document if they do exist there.- Parameters:
id
- The id or key of the documentvalue
- A representation of a single document- Returns:
- information about the document
- Throws:
DataAccessException
-
replaceAll
<T> com.arangodb.entity.MultiDocumentEntity<com.arangodb.entity.DocumentUpdateEntity<T>> replaceAll(Iterable<? extends T> values, com.arangodb.model.DocumentReplaceOptions options, Class<T> entityClass) throws DataAccessException Replaces multiple documents in the specified collection with the ones in the values, the replaced documents are specified by the _key attributes in the documents in values.- Type Parameters:
T
-- Parameters:
values
- A List of documentsentityClass
- The entity class which represents the collectionoptions
- Additional options, can be null- Returns:
- information about the documents
- Throws:
DataAccessException
-
replaceAll
<T> com.arangodb.entity.MultiDocumentEntity<com.arangodb.entity.DocumentUpdateEntity<?>> replaceAll(Iterable<? extends T> values, Class<T> entityClass) throws DataAccessException Replaces multiple documents in the specified collection with the ones in the values, the replaced documents are specified by the _key attributes in the documents in values.- Type Parameters:
T
-- Parameters:
values
- A List of documentsentityClass
- The entity class which represents the collection- Returns:
- information about the documents
- Throws:
DataAccessException
-
replace
<T> com.arangodb.entity.DocumentUpdateEntity<T> replace(Object id, T value, com.arangodb.model.DocumentReplaceOptions options) throws DataAccessException Replaces the document withid
with the one in the body, provided there is such a document and no precondition is violated- Parameters:
id
- The id or key of the documentvalue
- A representation of a single documentoptions
- Additional options, can be null- Returns:
- information about the document
- Throws:
DataAccessException
-
replace
com.arangodb.entity.DocumentUpdateEntity<?> replace(Object id, Object value) throws DataAccessException Replaces the document withid
with the one in the body, provided there is such a document and no precondition is violated- Parameters:
id
- The id or key of the documentvalue
- A representation of a single document- Returns:
- information about the document
- Throws:
DataAccessException
-
find
<T> Optional<T> find(Object id, Class<T> entityClass, com.arangodb.model.DocumentReadOptions options) throws DataAccessException Retrieves the document with the givenid
from a collection.- Parameters:
id
- The id or key of the documententityClass
- The entity class which represents the collectionoptions
- Additional options, can be null- Returns:
- the document identified by the id
- Throws:
DataAccessException
-
find
Retrieves the document with the givenid
from a collection.- Parameters:
id
- The id or key of the documententityClass
- The entity class which represents the collection- Returns:
- the document identified by the id
- Throws:
DataAccessException
-
findAll
Retrieves all documents from a collection.- Parameters:
entityClass
- The entity class which represents the collection- Returns:
- the documents
- Throws:
DataAccessException
-
findAll
Retrieves multiple documents with the givenids
from a collection.- Parameters:
ids
- The ids or keys of the documentsentityClass
- The entity class which represents the collection- Returns:
- the documents
- Throws:
DataAccessException
-
insertAll
<T> com.arangodb.entity.MultiDocumentEntity<com.arangodb.entity.DocumentCreateEntity<T>> insertAll(Iterable<? extends T> values, com.arangodb.model.DocumentCreateOptions options, Class<T> entityClass) throws DataAccessException Creates new documents from the given documents, unless there is already a document with the _key given. If no _key is given, a new unique _key is generated automatically.- Type Parameters:
T
-- Parameters:
values
- A List of documentsentityClass
- The entity class which represents the collectionoptions
- Additional options, can be null- Returns:
- information about the documents
- Throws:
DataAccessException
-
insertAll
<T> com.arangodb.entity.MultiDocumentEntity<com.arangodb.entity.DocumentCreateEntity<?>> insertAll(Iterable<? extends T> values, Class<T> entityClass) throws DataAccessException Creates new documents from the given documents, unless there is already a document with the _key given. If no _key is given, a new unique _key is generated automatically.- Parameters:
values
- A List of documentsentityClass
- The entity class which represents the collection- Returns:
- information about the documents
- Throws:
DataAccessException
-
insert
<T> com.arangodb.entity.DocumentCreateEntity<T> insert(T value, com.arangodb.model.DocumentCreateOptions options) throws DataAccessException Creates a new document from the given document, unless there is already a document with the _key given. If no _key is given, a new unique _key is generated automatically.- Parameters:
value
- A representation of a single documentoptions
- Additional options, can be null- Returns:
- information about the document
- Throws:
DataAccessException
-
insert
Creates a new document from the given document, unless there is already a document with the _key given. If no _key is given, a new unique _key is generated automatically.- Parameters:
value
- A representation of a single document- Returns:
- information about the document
- Throws:
DataAccessException
-
repsert
Creates a new document from the given document, unless there is already a document with the id given. In that case it replaces the document.- Parameters:
value
- A representation of a single document- Throws:
DataAccessException
- Since:
- ArangoDB 3.4
-
repsertAll
<T> Iterable<T> repsertAll(Iterable<T> values, Class<? super T> entityClass) throws DataAccessException Creates new documents from the given documents, unless there already exists. In that case it replaces the documents.- Parameters:
values
- A List of documentsentityClass
- The entity class which represents the collection- Throws:
DataAccessException
- Since:
- ArangoDB 3.4
-
exists
Checks whether the document exists by reading a single document head- Parameters:
id
- The id or key of the documententityClass
- The entity type representing the collection- Returns:
- true if the document exists, false if not
- Throws:
DataAccessException
-
dropDatabase
Drop an existing database- Throws:
DataAccessException
-
collection
Returns the operations interface for a collection. If the collection does not exists, it is created automatically.- Parameters:
entityClass
- The entity type representing the collection- Returns:
CollectionOperations
- Throws:
DataAccessException
-
collection
Returns the operations interface for a collection. If the collection does not exists, it is created automatically.- Parameters:
name
- The name of the collection- Returns:
CollectionOperations
- Throws:
DataAccessException
-
collection
CollectionOperations collection(String name, com.arangodb.model.CollectionCreateOptions options) throws DataAccessException Returns the operations interface for a collection. If the collection does not exists, it is created automatically.- Parameters:
name
- The name of the collectionoptions
- Additional options for collection creation, can be null- Returns:
CollectionOperations
- Throws:
DataAccessException
-
user
Return the operations interface for a user. The user is not created automatically if it does not exists.- Parameters:
username
- The name of the user- Returns:
UserOperations
-
getUsers
Fetches data about all users. You can only execute this call if you have access to the _system database.- Returns:
- information about all users
- Throws:
DataAccessException
-
getConverter
ArangoConverter getConverter() -
getResolverFactory
ResolverFactory getResolverFactory()
-