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 Type
    Method
    Description
    collection(Class<?> entityClass)
    Returns the operations interface for a collection.
    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>
    delete(Object id, com.arangodb.model.DocumentDeleteOptions options, Class<T> entityClass)
    Deletes the document with the given id from a collection.
    com.arangodb.entity.DocumentDeleteEntity<?>
    delete(Object id, Class<?> entityClass)
    Deletes the document with the given id 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<?>>
    deleteAll(Iterable<?> values, Class<?> entityClass)
    Deletes multiple documents from a collection.
    com.arangodb.ArangoDB
    Give direct access to the underlying driver
    void
    Drop an existing database
    boolean
    exists(Object id, Class<?> entityClass)
    Checks whether the document exists by reading a single document head
    <T> Optional<T>
    find(Object id, Class<T> entityClass)
    Retrieves the document with the given id from a collection.
    <T> Optional<T>
    find(Object id, Class<T> entityClass, com.arangodb.model.DocumentReadOptions options)
    Retrieves the document with the given id from a collection.
    <T> Iterable<T>
    findAll(Class<T> entityClass)
    Retrieves all documents from a collection.
    <T> Iterable<T>
    findAll(Iterable<?> ids, Class<T> entityClass)
    Retrieves multiple documents with the given ids from a collection.
     
     
    Iterable<com.arangodb.entity.UserEntity>
    Fetches data about all users.
    com.arangodb.entity.ArangoDBVersion
    Returns the server name and version number.
    com.arangodb.entity.DocumentCreateEntity<?>
    insert(Object value)
    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<?>>
    insertAll(Iterable<? extends T> values, Class<T> entityClass)
    Creates new documents from the given documents, unless there is already a document with the _key given.
    <T> com.arangodb.ArangoCursor<T>
    query(String query, com.arangodb.model.AqlQueryOptions options, Class<T> entityClass)
    Performs a database query using the given query, then returns a new ArangoCursor instance for the result list.
    <T> com.arangodb.ArangoCursor<T>
    query(String query, Class<T> entityClass)
    Performs a database query using the given query, then returns a new ArangoCursor 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 given query and bindVars, then returns a new ArangoCursor instance for the result list.
    <T> com.arangodb.ArangoCursor<T>
    query(String query, Map<String,Object> bindVars, Class<T> entityClass)
    Performs a database query using the given query and bindVars, then returns a new ArangoCursor instance for the result list.
    com.arangodb.entity.DocumentUpdateEntity<?>
    replace(Object id, Object value)
    Replaces the document with id with the one in the body, provided there is such a document and no precondition is violated
    <T> com.arangodb.entity.DocumentUpdateEntity<T>
    replace(Object id, T value, com.arangodb.model.DocumentReplaceOptions options)
    Replaces the document with id 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<?>
    update(Object id, Object value)
    Partially updates the document identified by document id or key.
    <T> com.arangodb.entity.DocumentUpdateEntity<T>
    update(Object id, T value, com.arangodb.model.DocumentUpdateOptions options)
    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<?>>
    updateAll(Iterable<? extends T> values, Class<T> entityClass)
    Partially updates documents, the documents to update are specified by the _key attributes in the objects on values.
    user(String username)
    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

      com.arangodb.entity.ArangoDBVersion getVersion() throws DataAccessException
      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 DataAccessException
      Performs a database query using the given query and bindVars, then returns a new ArangoCursor instance for the result list.
      Parameters:
      query - An AQL query string
      bindVars - key/value pairs defining the variables to bind the query to
      options - Additional options that will be passed to the query API, can be null
      entityClass - 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 DataAccessException
      Performs a database query using the given query and bindVars, then returns a new ArangoCursor instance for the result list.
      Parameters:
      query - An AQL query string
      bindVars - key/value pairs defining the variables to bind the query to
      entityClass - 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 given query, then returns a new ArangoCursor instance for the result list.
      Parameters:
      query - An AQL query string
      options - Additional options that will be passed to the query API, can be null
      entityClass - 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 given query, then returns a new ArangoCursor instance for the result list.
      Parameters:
      query - An AQL query string
      entityClass - 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 themselves
      entityClass - The entity class which represents the collection
      options - 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 themselves
      entityClass - 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 given id from a collection.
      Parameters:
      id - The id or key of the document
      entityClass - The entity class which represents the collection
      options - 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 given id from a collection.
      Parameters:
      id - The id or key of the document
      entityClass - 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 documents
      entityClass - The entity class which represents the collection
      options - 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 documents
      entityClass - 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 document
      value - A representation of a single document
      options - 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 document
      value - 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 documents
      entityClass - The entity class which represents the collection
      options - 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 documents
      entityClass - 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 with id 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 document
      value - A representation of a single document
      options - 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 with id 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 document
      value - 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 given id from a collection.
      Parameters:
      id - The id or key of the document
      entityClass - The entity class which represents the collection
      options - Additional options, can be null
      Returns:
      the document identified by the id
      Throws:
      DataAccessException
    • find

      <T> Optional<T> find(Object id, Class<T> entityClass) throws DataAccessException
      Retrieves the document with the given id from a collection.
      Parameters:
      id - The id or key of the document
      entityClass - The entity class which represents the collection
      Returns:
      the document identified by the id
      Throws:
      DataAccessException
    • findAll

      <T> Iterable<T> findAll(Class<T> entityClass) throws DataAccessException
      Retrieves all documents from a collection.
      Parameters:
      entityClass - The entity class which represents the collection
      Returns:
      the documents
      Throws:
      DataAccessException
    • findAll

      <T> Iterable<T> findAll(Iterable<?> ids, Class<T> entityClass) throws DataAccessException
      Retrieves multiple documents with the given ids from a collection.
      Parameters:
      ids - The ids or keys of the documents
      entityClass - 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 documents
      entityClass - The entity class which represents the collection
      options - 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 documents
      entityClass - 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 document
      options - Additional options, can be null
      Returns:
      information about the document
      Throws:
      DataAccessException
    • insert

      com.arangodb.entity.DocumentCreateEntity<?> insert(Object value) 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 document
      Returns:
      information about the document
      Throws:
      DataAccessException
    • repsert

      <T> T repsert(T value) throws DataAccessException
      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 documents
      entityClass - The entity class which represents the collection
      Throws:
      DataAccessException
      Since:
      ArangoDB 3.4
    • exists

      boolean exists(Object id, Class<?> entityClass) throws DataAccessException
      Checks whether the document exists by reading a single document head
      Parameters:
      id - The id or key of the document
      entityClass - The entity type representing the collection
      Returns:
      true if the document exists, false if not
      Throws:
      DataAccessException
    • dropDatabase

      void dropDatabase() throws DataAccessException
      Drop an existing database
      Throws:
      DataAccessException
    • collection

      CollectionOperations collection(Class<?> entityClass) throws DataAccessException
      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 collection
      options - Additional options for collection creation, can be null
      Returns:
      CollectionOperations
      Throws:
      DataAccessException
    • user

      UserOperations user(String username)
      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

      Iterable<com.arangodb.entity.UserEntity> getUsers() throws DataAccessException
      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()