Class AerospikeTemplate

java.lang.Object
org.springframework.data.aerospike.core.AerospikeTemplate
All Implemented Interfaces:
AerospikeOperations, IndexesCacheRefresher

public class AerospikeTemplate extends Object implements AerospikeOperations, IndexesCacheRefresher
Primary implementation of AerospikeOperations.
Author:
Oliver Gierke, Peter Milne, Anastasiia Smirnova, Igor Ermolenko, Roman Terentiev
  • Constructor Summary

    Constructors
    Constructor
    Description
    AerospikeTemplate(com.aerospike.client.IAerospikeClient client, String namespace, MappingAerospikeConverter converter, AerospikeMappingContext mappingContext, AerospikeExceptionTranslator exceptionTranslator, QueryEngine queryEngine, IndexRefresher indexRefresher, ServerVersionSupport serverVersionSupport)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    <T> T
    add(T document, String binName, long value)
    Find an existing record matching the document's class and id, add specified value to the record's bin and return the modified record mapped to the document's class.
    <T> T
    add(T document, String setName, String binName, long value)
    Find an existing record matching the document's id and the given set name, add specified value to the record's bin and return the modified record mapped to the document's class.
    <T> T
    add(T document, String setName, Map<String,Long> values)
    Find an existing record matching the document's id and the given set name, add map values to the corresponding bins of the record and return the modified record mapped to the document's class.
    <T> T
    add(T document, Map<String,Long> values)
    Find an existing record matching the document's class and id, add map values to the corresponding bins of the record and return the modified record mapped to the document's class.
    <T> com.aerospike.client.query.ResultSet
    aggregate(com.aerospike.client.query.Filter filter, Class<T> entityClass, String module, String function, List<com.aerospike.client.Value> arguments)
    Execute query, apply statement's aggregation function, and return result iterator.
    com.aerospike.client.query.ResultSet
    aggregate(com.aerospike.client.query.Filter filter, String setName, String module, String function, List<com.aerospike.client.Value> arguments)
    Execute query within the given set, apply statement's aggregation function, and return result iterator.
    <T> T
    append(T document, String binName, String value)
    Find an existing record matching the document's class and id, append specified value to the record's bin and return the modified record mapped to the document's class.
    <T> T
    append(T document, String setName, String binName, String value)
    Find an existing record matching the document's id and the given set name, append specified value to the record's bin and return the modified record mapped to the document's class.
    <T> T
    append(T document, String setName, Map<String,String> values)
    Find an existing record matching the document's id and the given set name, append map values to the corresponding bins of the record and return the modified record mapped to the document's class.
    <T> T
    append(T document, Map<String,String> values)
    Find an existing record matching the document's class and id, append map values to the corresponding bins of the record and return the modified record mapped to the document's class.
    <T> long
    count(Class<T> entityClass)
    Return the amount of records in the set determined by the given entityClass.
    long
    count(String setName)
    Return the amount of records in the given Aerospike set.
    <T> long
    count(Query query, Class<T> entityClass)
    Return the amount of records in query results.
    long
    count(Query query, String setName)
    Return the amount of records in query results within the given set.
    <T> void
    createIndex(Class<T> entityClass, String indexName, String binName, com.aerospike.client.query.IndexType indexType)
    Create an index with the specified name in Aerospike.
    <T> void
    createIndex(Class<T> entityClass, String indexName, String binName, com.aerospike.client.query.IndexType indexType, com.aerospike.client.query.IndexCollectionType indexCollectionType)
    Create an index with the specified name in Aerospike.
    <T> void
    createIndex(Class<T> entityClass, String indexName, String binName, com.aerospike.client.query.IndexType indexType, com.aerospike.client.query.IndexCollectionType indexCollectionType, com.aerospike.client.cdt.CTX... ctx)
    Create an index with the specified name in Aerospike.
    void
    createIndex(String setName, String indexName, String binName, com.aerospike.client.query.IndexType indexType)
    Create an index with the specified name in Aerospike.
    void
    createIndex(String setName, String indexName, String binName, com.aerospike.client.query.IndexType indexType, com.aerospike.client.query.IndexCollectionType indexCollectionType)
    Create an index with the specified name in Aerospike.
    void
    createIndex(String setName, String indexName, String binName, com.aerospike.client.query.IndexType indexType, com.aerospike.client.query.IndexCollectionType indexCollectionType, com.aerospike.client.cdt.CTX... ctx)
    Create an index with the specified name in Aerospike.
    <T> void
    delete(Class<T> entityClass)
    Deprecated, for removal: This API element is subject to removal in a future version.
    <T> boolean
    delete(Object id, Class<T> entityClass)
    Deprecated, for removal: This API element is subject to removal in a future version.
    <T> boolean
    delete(T document)
    Delete a record using the document's id.
    <T> boolean
    delete(T document, String setName)
    Delete a record within the given set using the document's id.
    <T> void
    deleteAll(Class<T> entityClass)
    Truncate/Delete all records in the set determined by the given entity class.
    <T> void
    deleteAll(Class<T> entityClass, Instant beforeLastUpdate)
    Truncate/Delete all documents in the given set.
    <T> void
    deleteAll(Iterable<T> documents)
    Delete multiple records in one batch request.
    <T> void
    deleteAll(Iterable<T> documents, String setName)
    Delete multiple records within the given set (overrides the default set associated with the documents) in one batch request.
    void
    deleteAll(String setName)
    Truncate/Delete all documents in the given set.
    void
    deleteAll(String setName, Instant beforeLastUpdate)
    Truncate/Delete all documents in the given set.
    <T> boolean
    deleteById(Object id, Class<T> entityClass)
    Delete a record by id, set name will be determined by the given entityClass.
    boolean
    deleteById(Object id, String setName)
    Delete a record by id within the given set.
    <T> void
    deleteByIds(Iterable<?> ids, Class<T> entityClass)
    Delete records by ids using a single batch delete operation, set name will be determined by the given entityClass.
    void
    deleteByIds(Iterable<?> ids, String setName)
    Delete records by ids within the given set using a single batch delete operation.
    void
    deleteByIds(GroupedKeys groupedKeys)
    Perform a single batch delete operation for records from different sets.
    <T> void
    deleteIndex(Class<T> entityClass, String indexName)
    Delete an index with the specified name in Aerospike.
    void
    deleteIndex(String setName, String indexName)
    Delete an index with the specified name within the given set in Aerospike.
    <T> T
    execute(Supplier<T> supplier)
    Execute an operation against underlying store.
    <T> boolean
    exists(Object id, Class<T> entityClass)
    Check by id if a record exists within the set associated with the given entityClass.
    boolean
    exists(Object id, String setName)
    Check by id if a record exists within the given set name.
    <T> boolean
    existsByQuery(Query query, Class<T> entityClass)
    Check using a query if any matching records exist within the set associated with the given entityClass.
    <T> boolean
    existsByQuery(Query query, Class<T> entityClass, String setName)
    Check using a query if any matching records exist within the given set.
    <T> Stream<T>
    find(Query query, Class<T> entityClass)
    Find records in the given entityClass's set using a query and map them to the given class type.
    <T, S> Stream<S>
    find(Query query, Class<T> entityClass, Class<S> targetClass)
    Find records in the given entityClass's set using a query and map them to the given target class type.
    <T> Stream<T>
    find(Query query, Class<T> targetClass, String setName)
    Find records in the given set using a query and map them to the given target class type.
    <T> Stream<T>
    findAll(Class<T> entityClass)
    Find all records in the given entityClass's set and map them to the given class type.
    <T, S> Stream<S>
    findAll(Class<T> entityClass, Class<S> targetClass)
    Find all records in the given entityClass's set and map them to the given target class type.
    <T> Stream<T>
    findAll(Class<T> targetClass, String setName)
    Find all records in the given set and map them to the given class type.
    <T> Stream<T>
    findAll(Sort sort, long offset, long limit, Class<T> entityClass)
    Find all records in the given entityClass's set using a provided sort and map them to the given class type.
    <T, S> Stream<S>
    findAll(Sort sort, long offset, long limit, Class<T> entityClass, Class<S> targetClass)
    Find all records in the given entityClass's set using a provided sort and map them to the given target class type.
    <T> Stream<T>
    findAll(Sort sort, long offset, long limit, Class<T> targetClass, String setName)
    Find all records in the given set using a provided sort and map them to the given target class type.
    <T> T
    findById(Object id, Class<T> entityClass)
    Find a record by id, set name will be determined by the given entityClass.
    <T, S> S
    findById(Object id, Class<T> entityClass, Class<S> targetClass)
    Find a record by id, set name will be determined by the given entityClass.
    <T, S> S
    findById(Object id, Class<T> entityClass, Class<S> targetClass, String setName)
    Find a record by id within the given set.
    <T> T
    findById(Object id, Class<T> entityClass, String setName)
    Find a record by id within the given set.
    <T> List<T>
    findByIds(Iterable<?> ids, Class<T> entityClass)
    Find records by ids using a single batch read operation, set name will be determined by the given entityClass.
    <T, S> List<S>
    findByIds(Iterable<?> ids, Class<T> entityClass, Class<S> targetClass)
    Find records by ids using a single batch read operation, set name will be determined by the given entityClass.
    <T, S> List<S>
    findByIds(Iterable<?> ids, Class<T> entityClass, Class<S> targetClass, String setName)
    Find records by ids within the given set using a single batch read operation.
    <T> List<T>
    findByIds(Iterable<?> ids, Class<T> entityClass, String setName)
    Find records by ids within the given set using a single batch read operation.
    findByIds(GroupedKeys groupedKeys)
    Execute a single batch request to find several records, possibly from different sets.
    <T, S> List<?>
    findByIdsUsingQuery(Collection<?> ids, Class<T> entityClass, Class<S> targetClass, String setName, Query query)
    Find records by ids within the given set.
    <T, S> List<?>
    findByIdsUsingQuery(Collection<?> ids, Class<T> entityClass, Class<S> targetClass, Query query)
    Find records by ids and a query, set name will be determined by the given entityClass.
    <T, S> Object
    findByIdUsingQuery(Object id, Class<T> entityClass, Class<S> targetClass, String setName, Query query)
    Find a record by id within the given set using a query.
    <T, S> Object
    findByIdUsingQuery(Object id, Class<T> entityClass, Class<S> targetClass, Query query)
    Find a record by id using a query, set name will be determined by the given entityClass.
    <T> Stream<T>
    findInRange(long offset, long limit, Sort sort, Class<T> entityClass)
    Find records in the given entityClass's set using a range (offset, limit) and a sort and map them to the given class type.
    <T, S> Stream<S>
    findInRange(long offset, long limit, Sort sort, Class<T> entityClass, Class<S> targetClass)
    Find records in the given entityClass's set using a range (offset, limit) and a sort and map them to the given target class type.
    <T> Stream<T>
    findInRange(long offset, long limit, Sort sort, Class<T> targetClass, String setName)
    Find records in the given set using a range (offset, limit) and a sort and map them to the given target class type.
    <T, S> Stream<S>
    findUsingQueryWithoutPostProcessing(Class<T> entityClass, Class<S> targetClass, Query query)
    Find records in the given entityClass set using a query and map them to the given target class type.
    com.aerospike.client.IAerospikeClient
     
     
    <T> org.springframework.data.aerospike.core.BaseAerospikeTemplate.BatchWriteData<T>
    getBatchWriteForDelete(T document, String setName)
     
    <T> org.springframework.data.aerospike.core.BaseAerospikeTemplate.BatchWriteData<T>
    getBatchWriteForInsert(T document, String setName)
     
    <T> org.springframework.data.aerospike.core.BaseAerospikeTemplate.BatchWriteData<T>
    getBatchWriteForSave(T document, String setName)
     
    <T> org.springframework.data.aerospike.core.BaseAerospikeTemplate.BatchWriteData<T>
    getBatchWriteForUpdate(T document, String setName)
     
     
     
    long
     
    <T> String
    getSetName(Class<T> entityClass)
     
    <T> String
    getSetName(T document)
     
    boolean
    indexExists(String indexName)
    Check whether an index with the specified name exists in Aerospike.
    <T> void
    insert(T document)
    Insert a document using RecordExistsAction.CREATE_ONLY policy.
    <T> void
    insert(T document, String setName)
    Insert a document within the given set (overrides the set associated with the document) using RecordExistsAction.CREATE_ONLY policy.
    <T> void
    insertAll(Iterable<? extends T> documents)
    Insert multiple documents in one batch request.
    <T> void
    insertAll(Iterable<? extends T> documents, String setName)
    Insert multiple documents within the given set (overrides the set associated with the document) in one batch request.
    <T> void
    persist(T document, com.aerospike.client.policy.WritePolicy policy)
    Persist a document using specified WritePolicy.
    <T> void
    persist(T document, com.aerospike.client.policy.WritePolicy policy, String setName)
    Persist a document within the given set (overrides the default set associated with the document) using specified WritePolicy.
    <T> T
    prepend(T document, String fieldName, String value)
    Find an existing record matching the document's class and id, prepend specified value to the record's bin and return the modified record mapped to the document's class.
    <T> T
    prepend(T document, String setName, String fieldName, String value)
    Find an existing record matching the document's id and the given set name, prepend specified value to the record's bin and return the modified record mapped to the document's class.
    <T> T
    prepend(T document, String setName, Map<String,String> values)
    Find an existing record matching the document's id and the given set name, prepend map values to the corresponding bins of the record and return the modified record mapped to the document's class.
    <T> T
    prepend(T document, Map<String,String> values)
    Find an existing record matching the document's class and id, prepend map values to the corresponding bins of the record and return the modified record mapped to the document's class.
    void
     
    <T> void
    save(T document)
    Save a document.
    <T> void
    save(T document, String setName)
    Save a document within the given set (overrides the set associated with the document)
    <T> void
    saveAll(Iterable<T> documents)
    Save multiple documents in one batch request.
    <T> void
    saveAll(Iterable<T> documents, String setName)
    Save multiple documents within the given set (overrides the default set associated with the documents) in one batch request.
    <T> void
    update(T document)
    Update a record using RecordExistsAction.UPDATE_ONLY policy combined with removing bins at first (analogous to RecordExistsAction.REPLACE_ONLY) taking into consideration the version property of the document if it is present.
    <T> void
    update(T document, String setName)
    Update a record with the given set (overrides the set associated with the document) using RecordExistsAction.UPDATE_ONLY policy combined with removing bins at first (analogous to RecordExistsAction.REPLACE_ONLY) taking into consideration the version property of the document if it is present.
    <T> void
    update(T document, String setName, Collection<String> fields)
    Update specific fields of a record based on the given collection of fields with the given set (overrides the set associated with the document) using RecordExistsAction.UPDATE_ONLY policy.
    <T> void
    update(T document, Collection<String> fields)
    Update specific fields of a record based on the given collection of fields using RecordExistsAction.UPDATE_ONLY policy.
    <T> void
    updateAll(Iterable<T> documents)
    Update multiple records in one batch request.
    <T> void
    updateAll(Iterable<T> documents, String setName)
    Update multiple records within the given set (overrides the default set associated with the documents) in one batch request.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.springframework.data.aerospike.core.AerospikeOperations

    getAerospikeConverter, getMappingContext, getSetName, getSetName
  • Constructor Details

  • Method Details

    • getAerospikeClient

      public com.aerospike.client.IAerospikeClient getAerospikeClient()
      Specified by:
      getAerospikeClient in interface AerospikeOperations
      Returns:
      Aerospike client in use.
    • getQueryMaxRecords

      public long getQueryMaxRecords()
      Specified by:
      getQueryMaxRecords in interface AerospikeOperations
      Returns:
      Value of configuration parameter
      invalid reference
      AerospikeDataSettings#getQueryMaxRecords()
      .
    • refreshIndexesCache

      public void refreshIndexesCache()
      Specified by:
      refreshIndexesCache in interface IndexesCacheRefresher
    • save

      public <T> void save(T document)
      Description copied from interface: AerospikeOperations
      Save a document.

      If the document has version property, CAS algorithm is used for updating record. Version property is used for deciding whether to create a new record or update an existing one. If the version is set to zero, a new record will be created, creation will fail if such record already exists. If the version is greater than zero, existing record will be updated with RecordExistsAction.UPDATE_ONLY policy combined with removing bins at first (analogous to RecordExistsAction.REPLACE_ONLY) taking into consideration the version property of the document. Document's version property will be updated with the server's version after successful operation.

      If the document does not have version property, record is updated with RecordExistsAction.UPDATE policy combined with removing bins at first (analogous to RecordExistsAction.REPLACE). This means that when such record does not exist it will be created, otherwise updated (an "upsert").

      Specified by:
      save in interface AerospikeOperations
      Parameters:
      document - The document to be saved. Must not be null.
    • save

      public <T> void save(T document, String setName)
      Description copied from interface: AerospikeOperations
      Save a document within the given set (overrides the set associated with the document)

      If the document has version property, CAS algorithm is used for updating record. Version property is used for deciding whether to create a new record or update an existing one. If the version is set to zero, a new record will be created, creation will fail if such record already exists. If the version is greater than zero, existing record will be updated with RecordExistsAction.UPDATE_ONLY policy combined with removing bins at first (analogous to RecordExistsAction.REPLACE_ONLY) taking into consideration the version property of the document. Document's version property will be updated with the server's version after successful operation.

      If the document does not have version property, record is updated with RecordExistsAction.UPDATE policy combined with removing bins at first (analogous to RecordExistsAction.REPLACE). This means that when such record does not exist it will be created, otherwise updated (an "upsert").

      Specified by:
      save in interface AerospikeOperations
      Parameters:
      document - The document to be saved. Must not be null.
      setName - Set name to override the set associated with the document.
    • saveAll

      public <T> void saveAll(Iterable<T> documents)
      Description copied from interface: AerospikeOperations
      Save multiple documents in one batch request. The policies are analogous to AerospikeOperations.save(Object).

      The order of returned results is preserved. The execution order is NOT preserved.

      This operation requires Server version 6.0+.

      Specified by:
      saveAll in interface AerospikeOperations
      Parameters:
      documents - The documents to be saved. Must not be null.
    • saveAll

      public <T> void saveAll(Iterable<T> documents, String setName)
      Description copied from interface: AerospikeOperations
      Save multiple documents within the given set (overrides the default set associated with the documents) in one batch request. The policies are analogous to AerospikeOperations.save(Object).

      The order of returned results is preserved. The execution order is NOT preserved.

      This operation requires Server version 6.0+.

      Specified by:
      saveAll in interface AerospikeOperations
      Parameters:
      documents - The documents to be saved. Must not be null.
      setName - Set name to override the default set associated with the documents.
    • insert

      public <T> void insert(T document)
      Description copied from interface: AerospikeOperations
      Insert a document using RecordExistsAction.CREATE_ONLY policy.

      If the document has version property it will be updated with the server's version after successful operation.

      Specified by:
      insert in interface AerospikeOperations
      Parameters:
      document - The document to be inserted. Must not be null.
    • insert

      public <T> void insert(T document, String setName)
      Description copied from interface: AerospikeOperations
      Insert a document within the given set (overrides the set associated with the document) using RecordExistsAction.CREATE_ONLY policy.

      If document has version property, it will be updated with the server's version after successful operation.

      Specified by:
      insert in interface AerospikeOperations
      Parameters:
      document - The document to be inserted. Must not be null.
      setName - Set name to override the set associated with the document.
    • insertAll

      public <T> void insertAll(Iterable<? extends T> documents)
      Description copied from interface: AerospikeOperations
      Insert multiple documents in one batch request. The policies are analogous to AerospikeOperations.insert(Object).

      The order of returned results is preserved. The execution order is NOT preserved.

      This operation requires Server version 6.0+.

      Specified by:
      insertAll in interface AerospikeOperations
      Parameters:
      documents - Documents to be inserted. Must not be null.
    • insertAll

      public <T> void insertAll(Iterable<? extends T> documents, String setName)
      Description copied from interface: AerospikeOperations
      Insert multiple documents within the given set (overrides the set associated with the document) in one batch request. The policies are analogous to AerospikeOperations.insert(Object).

      The order of returned results is preserved. The execution order is NOT preserved.

      This operation requires Server version 6.0+.

      Specified by:
      insertAll in interface AerospikeOperations
      Parameters:
      documents - Documents to be inserted. Must not be null.
      setName - Set name to override the set associated with the document.
    • persist

      public <T> void persist(T document, com.aerospike.client.policy.WritePolicy policy)
      Description copied from interface: AerospikeOperations
      Persist a document using specified WritePolicy.
      Specified by:
      persist in interface AerospikeOperations
      Parameters:
      document - The document to be persisted. Must not be null.
      policy - The Aerospike write policy for the inner Aerospike put operation. Must not be null.
    • persist

      public <T> void persist(T document, com.aerospike.client.policy.WritePolicy policy, String setName)
      Description copied from interface: AerospikeOperations
      Persist a document within the given set (overrides the default set associated with the document) using specified WritePolicy.
      Specified by:
      persist in interface AerospikeOperations
      Parameters:
      document - The document to be persisted. Must not be null.
      policy - The Aerospike write policy for the inner Aerospike put operation. Must not be null.
      setName - Set name to override the set associated with the document.
    • update

      public <T> void update(T document)
      Description copied from interface: AerospikeOperations
      Update a record using RecordExistsAction.UPDATE_ONLY policy combined with removing bins at first (analogous to RecordExistsAction.REPLACE_ONLY) taking into consideration the version property of the document if it is present.

      If document has version property it will be updated with the server's version after successful operation.

      Specified by:
      update in interface AerospikeOperations
      Parameters:
      document - The document that identifies the record to be updated. Must not be null.
    • update

      public <T> void update(T document, String setName)
      Description copied from interface: AerospikeOperations
      Update a record with the given set (overrides the set associated with the document) using RecordExistsAction.UPDATE_ONLY policy combined with removing bins at first (analogous to RecordExistsAction.REPLACE_ONLY) taking into consideration the version property of the document if it is present.

      If document has version property it will be updated with the server's version after successful operation.

      Specified by:
      update in interface AerospikeOperations
      Parameters:
      document - The document that identifies the record to be updated. Must not be null.
      setName - Set name to override the set associated with the document.
    • update

      public <T> void update(T document, Collection<String> fields)
      Description copied from interface: AerospikeOperations
      Update specific fields of a record based on the given collection of fields using RecordExistsAction.UPDATE_ONLY policy. You can instantiate the document with only the relevant fields and specify the list of fields that you want to update. Taking into consideration the version property of the document if it is present.

      If document has version property it will be updated with the server's version after successful operation.

      Specified by:
      update in interface AerospikeOperations
      Parameters:
      document - The document that identifies the record to be updated. Must not be null.
      fields - Specific fields to update.
    • update

      public <T> void update(T document, String setName, Collection<String> fields)
      Description copied from interface: AerospikeOperations
      Update specific fields of a record based on the given collection of fields with the given set (overrides the set associated with the document) using RecordExistsAction.UPDATE_ONLY policy. You can instantiate the document with only the relevant fields and specify the list of fields that you want to update. Taking into consideration the version property of the document if it is present.

      If document has version property it will be updated with the server's version after successful operation.

      Specified by:
      update in interface AerospikeOperations
      Parameters:
      document - The document that identifies the record to be updated. Must not be null.
      setName - Set name to override the set associated with the document.
      fields - Specific fields to update.
    • updateAll

      public <T> void updateAll(Iterable<T> documents)
      Description copied from interface: AerospikeOperations
      Update multiple records in one batch request. The policies are analogous to AerospikeOperations.update(Object).

      The order of returned results is preserved. The execution order is NOT preserved.

      This operation requires Server version 6.0+.

      Specified by:
      updateAll in interface AerospikeOperations
      Parameters:
      documents - The documents that identify the records to be updated. Must not be null.
    • updateAll

      public <T> void updateAll(Iterable<T> documents, String setName)
      Description copied from interface: AerospikeOperations
      Update multiple records within the given set (overrides the default set associated with the documents) in one batch request. The policies are analogous to AerospikeOperations.update(Object).

      The order of returned results is preserved. The execution order is NOT preserved.

      This operation requires Server version 6.0+.

      Specified by:
      updateAll in interface AerospikeOperations
      Parameters:
      documents - The documents that identify the records to be updated. Must not be null.
      setName - Set name to override the set associated with the document.
    • delete

      @Deprecated(since="4.6.0", forRemoval=true) public <T> void delete(Class<T> entityClass)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: AerospikeOperations
      Truncate/Delete all records in the set determined by the given entityClass.
      Specified by:
      delete in interface AerospikeOperations
      Parameters:
      entityClass - The class to extract set name from. Must not be null.
    • delete

      @Deprecated(since="4.6.0", forRemoval=true) public <T> boolean delete(Object id, Class<T> entityClass)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: AerospikeOperations
      Delete a record by id, set name will be determined by the given entityClass.
      Specified by:
      delete in interface AerospikeOperations
      Parameters:
      id - The id of the record to delete. Must not be null.
      entityClass - The class to extract set name from. Must not be null.
      Returns:
      whether the record existed on server before deletion.
    • delete

      public <T> boolean delete(T document)
      Description copied from interface: AerospikeOperations
      Delete a record using the document's id.

      If the document has version property it will be compared with the corresponding record's version on server.

      Specified by:
      delete in interface AerospikeOperations
      Parameters:
      document - The document to get set name and id from. Must not be null.
      Returns:
      Whether the record existed on server before deletion.
    • delete

      public <T> boolean delete(T document, String setName)
      Description copied from interface: AerospikeOperations
      Delete a record within the given set using the document's id.

      If the document has version property it will be compared with the corresponding record's version on server.

      Specified by:
      delete in interface AerospikeOperations
      Parameters:
      document - The document to get id from. Must not be null.
      setName - Set name to use.
      Returns:
      Whether the record existed on server before deletion.
    • deleteById

      public <T> boolean deleteById(Object id, Class<T> entityClass)
      Description copied from interface: AerospikeOperations
      Delete a record by id, set name will be determined by the given entityClass.

      If the document has version property it is not compared with the corresponding record's version on server.

      Specified by:
      deleteById in interface AerospikeOperations
      Parameters:
      id - The id of the record to be deleted. Must not be null.
      entityClass - The class to extract set name from. Must not be null.
      Returns:
      Whether the record existed on server before deletion.
    • deleteById

      public boolean deleteById(Object id, String setName)
      Description copied from interface: AerospikeOperations
      Delete a record by id within the given set.

      If the document has version property it is not compared with the corresponding record's version on server.

      Specified by:
      deleteById in interface AerospikeOperations
      Parameters:
      id - The id of the record to be deleted. Must not be null.
      setName - Set name to use.
      Returns:
      Whether the record existed on server before deletion.
    • deleteAll

      public <T> void deleteAll(Iterable<T> documents)
      Description copied from interface: AerospikeOperations
      Delete multiple records in one batch request. The policies are analogous to AerospikeOperations.delete(Object).

      The execution order is NOT preserved.

      This operation requires Server version 6.0+.

      Specified by:
      deleteAll in interface AerospikeOperations
      Parameters:
      documents - The documents to be deleted. Must not be null.
    • deleteAll

      public <T> void deleteAll(Iterable<T> documents, String setName)
      Description copied from interface: AerospikeOperations
      Delete multiple records within the given set (overrides the default set associated with the documents) in one batch request. The policies are analogous to AerospikeOperations.delete(Object).

      The execution order is NOT preserved.

      This operation requires Server version 6.0+.

      Specified by:
      deleteAll in interface AerospikeOperations
      Parameters:
      documents - The documents to be deleted. Must not be null.
      setName - Set name to override the default set associated with the documents.
    • deleteByIds

      public <T> void deleteByIds(Iterable<?> ids, Class<T> entityClass)
      Description copied from interface: AerospikeOperations
      Delete records by ids using a single batch delete operation, set name will be determined by the given entityClass. The policies are analogous to AerospikeOperations.deleteById(Object, Class).

      This operation requires Server version 6.0+.

      Specified by:
      deleteByIds in interface AerospikeOperations
      Parameters:
      ids - The ids of the records to be deleted. Must not be null.
      entityClass - The class to extract set name from. Must not be null.
    • deleteByIds

      public void deleteByIds(Iterable<?> ids, String setName)
      Description copied from interface: AerospikeOperations
      Delete records by ids within the given set using a single batch delete operation. The policies are analogous to AerospikeOperations.deleteById(Object, String).

      This operation requires Server version 6.0+.

      Specified by:
      deleteByIds in interface AerospikeOperations
      Parameters:
      ids - The ids of the records to be deleted. Must not be null.
      setName - Set name to use.
    • deleteByIds

      public void deleteByIds(GroupedKeys groupedKeys)
      Description copied from interface: AerospikeOperations
      Perform a single batch delete operation for records from different sets.

      Records' versions on server are not checked.

      This operation requires Server 6.0+.

      Specified by:
      deleteByIds in interface AerospikeOperations
      Parameters:
      groupedKeys - Keys grouped by document type. Must not be null, groupedKeys.getEntitiesKeys() must not be null.
    • deleteAll

      public <T> void deleteAll(Class<T> entityClass)
      Description copied from interface: AerospikeOperations
      Truncate/Delete all records in the set determined by the given entity class.
      Specified by:
      deleteAll in interface AerospikeOperations
      Parameters:
      entityClass - The class to extract set name from. Must not be null.
    • deleteAll

      public <T> void deleteAll(Class<T> entityClass, Instant beforeLastUpdate)
      Description copied from interface: AerospikeOperations
      Truncate/Delete all documents in the given set.
      Specified by:
      deleteAll in interface AerospikeOperations
      Parameters:
      entityClass - The class to extract set name from. Must not be null.
      beforeLastUpdate - Delete records before the specified time (must be earlier than the current time at millisecond resolution).
    • deleteAll

      public void deleteAll(String setName)
      Description copied from interface: AerospikeOperations
      Truncate/Delete all documents in the given set.
      Specified by:
      deleteAll in interface AerospikeOperations
      Parameters:
      setName - Set name to truncate/delete all records in.
    • deleteAll

      public void deleteAll(String setName, Instant beforeLastUpdate)
      Description copied from interface: AerospikeOperations
      Truncate/Delete all documents in the given set.
      Specified by:
      deleteAll in interface AerospikeOperations
      Parameters:
      setName - Set name to truncate/delete all records in.
      beforeLastUpdate - Delete records before the specified time (must be earlier than the current time at millisecond resolution).
    • add

      public <T> T add(T document, Map<String,Long> values)
      Description copied from interface: AerospikeOperations
      Find an existing record matching the document's class and id, add map values to the corresponding bins of the record and return the modified record mapped to the document's class.
      Specified by:
      add in interface AerospikeOperations
      Parameters:
      document - The document to get set name and id from and to map the record to. Must not be null.
      values - The Map of bin names and values to add. Must not be null.
      Returns:
      Modified record mapped to the document's class.
    • add

      public <T> T add(T document, String setName, Map<String,Long> values)
      Description copied from interface: AerospikeOperations
      Find an existing record matching the document's id and the given set name, add map values to the corresponding bins of the record and return the modified record mapped to the document's class.
      Specified by:
      add in interface AerospikeOperations
      Parameters:
      document - The document to get id from and to map the record to. Must not be null.
      setName - Set name to use.
      values - The Map of bin names and values to add. Must not be null.
      Returns:
      Modified record mapped to the document's class.
    • add

      public <T> T add(T document, String binName, long value)
      Description copied from interface: AerospikeOperations
      Find an existing record matching the document's class and id, add specified value to the record's bin and return the modified record mapped to the document's class.
      Specified by:
      add in interface AerospikeOperations
      Parameters:
      document - The document to get set name and id from and to map the record to. Must not be null.
      binName - Bin name to use add operation on. Must not be null.
      value - The value to add.
      Returns:
      Modified record mapped to the document's class.
    • add

      public <T> T add(T document, String setName, String binName, long value)
      Description copied from interface: AerospikeOperations
      Find an existing record matching the document's id and the given set name, add specified value to the record's bin and return the modified record mapped to the document's class.
      Specified by:
      add in interface AerospikeOperations
      Parameters:
      document - The document to get id from and to map the record to. Must not be null.
      setName - Set name to use.
      binName - Bin name to use add operation on. Must not be null.
      value - The value to add.
      Returns:
      Modified record mapped to the document's class.
    • append

      public <T> T append(T document, Map<String,String> values)
      Description copied from interface: AerospikeOperations
      Find an existing record matching the document's class and id, append map values to the corresponding bins of the record and return the modified record mapped to the document's class.
      Specified by:
      append in interface AerospikeOperations
      Parameters:
      document - The document to get set name and id from and to map the record to. Must not be null.
      values - The Map of bin names and values to append. Must not be null.
      Returns:
      Modified record mapped to the document's class.
    • append

      public <T> T append(T document, String setName, Map<String,String> values)
      Description copied from interface: AerospikeOperations
      Find an existing record matching the document's id and the given set name, append map values to the corresponding bins of the record and return the modified record mapped to the document's class.
      Specified by:
      append in interface AerospikeOperations
      Parameters:
      document - The document to get id from and to map the record to. Must not be null.
      setName - Set name to use.
      values - The Map of bin names and values to append. Must not be null.
      Returns:
      Modified record mapped to the document's class.
    • append

      public <T> T append(T document, String binName, String value)
      Description copied from interface: AerospikeOperations
      Find an existing record matching the document's class and id, append specified value to the record's bin and return the modified record mapped to the document's class.
      Specified by:
      append in interface AerospikeOperations
      Parameters:
      document - The document to get set name and id from and to map the record to. Must not be null.
      binName - Bin name to use append operation on.
      value - The value to append.
      Returns:
      Modified record mapped to the document's class.
    • append

      public <T> T append(T document, String setName, String binName, String value)
      Description copied from interface: AerospikeOperations
      Find an existing record matching the document's id and the given set name, append specified value to the record's bin and return the modified record mapped to the document's class.
      Specified by:
      append in interface AerospikeOperations
      Parameters:
      document - The document to get id from and to map the record to. Must not be null.
      setName - Set name to use.
      binName - Bin name to use append operation on.
      value - The value to append.
      Returns:
      Modified record mapped to the document's class.
    • prepend

      public <T> T prepend(T document, String fieldName, String value)
      Description copied from interface: AerospikeOperations
      Find an existing record matching the document's class and id, prepend specified value to the record's bin and return the modified record mapped to the document's class.
      Specified by:
      prepend in interface AerospikeOperations
      Parameters:
      document - The document to get set name and id from and to map the record to. Must not be null.
      fieldName - Bin name to use prepend operation on.
      value - The value to prepend.
      Returns:
      Modified record mapped to the document's class.
    • prepend

      public <T> T prepend(T document, String setName, String fieldName, String value)
      Description copied from interface: AerospikeOperations
      Find an existing record matching the document's id and the given set name, prepend specified value to the record's bin and return the modified record mapped to the document's class.
      Specified by:
      prepend in interface AerospikeOperations
      Parameters:
      document - The document to get id from and to map the record to. Must not be null.
      setName - Set name to use.
      fieldName - Bin name to use prepend operation on.
      value - The value to prepend.
      Returns:
      Modified record mapped to the document's class.
    • prepend

      public <T> T prepend(T document, Map<String,String> values)
      Description copied from interface: AerospikeOperations
      Find an existing record matching the document's class and id, prepend map values to the corresponding bins of the record and return the modified record mapped to the document's class.
      Specified by:
      prepend in interface AerospikeOperations
      Parameters:
      document - The document to get set name and id from and to map the record to. Must not be null.
      values - The Map of bin names and values to prepend. Must not be null.
      Returns:
      Modified record mapped to the document's class.
    • prepend

      public <T> T prepend(T document, String setName, Map<String,String> values)
      Description copied from interface: AerospikeOperations
      Find an existing record matching the document's id and the given set name, prepend map values to the corresponding bins of the record and return the modified record mapped to the document's class.
      Specified by:
      prepend in interface AerospikeOperations
      Parameters:
      document - The document to get id from and to map the record to. Must not be null.
      setName - Set name to use.
      values - The Map of bin names and values to prepend. Must not be null.
      Returns:
      Modified record mapped to the document's class.
    • execute

      public <T> T execute(Supplier<T> supplier)
      Description copied from interface: AerospikeOperations
      Execute an operation against underlying store.
      Specified by:
      execute in interface AerospikeOperations
      Parameters:
      supplier - must not be null.
      Returns:
      The resulting document.
    • findById

      public <T> T findById(Object id, Class<T> entityClass)
      Description copied from interface: AerospikeOperations
      Find a record by id, set name will be determined by the given entityClass.

      The matching record will be mapped to the given entityClass.

      Specified by:
      findById in interface AerospikeOperations
      Parameters:
      id - The id of the record to find. Must not be null.
      entityClass - The class to extract set name from and to map the record to. Must not be null.
      Returns:
      The document mapped to entityClass's type or null if nothing is found
    • findById

      public <T> T findById(Object id, Class<T> entityClass, String setName)
      Description copied from interface: AerospikeOperations
      Find a record by id within the given set.

      The matching record will be mapped to the given entityClass.

      Specified by:
      findById in interface AerospikeOperations
      Parameters:
      id - The id of the record to find. Must not be null.
      entityClass - The class to map the record to and to get entity properties from (such as expiration). Must not be null.
      setName - Set name to find the document from.
      Returns:
      The record mapped to entityClass's type or null if document does not exist
    • findById

      public <T, S> S findById(Object id, Class<T> entityClass, Class<S> targetClass)
      Description copied from interface: AerospikeOperations
      Find a record by id, set name will be determined by the given entityClass.

      The matching record will be mapped to the given entityClass.

      Specified by:
      findById in interface AerospikeOperations
      Parameters:
      id - The id of the record to find. Must not be null.
      entityClass - The class to extract set name from. Must not be null.
      targetClass - The class to map the record to. Must not be null.
      Returns:
      The record mapped to targetClass's type or null if document doesn't exist.
    • findById

      public <T, S> S findById(Object id, Class<T> entityClass, Class<S> targetClass, String setName)
      Description copied from interface: AerospikeOperations
      Find a record by id within the given set.

      The matching record will be mapped to the given entityClass.

      Specified by:
      findById in interface AerospikeOperations
      Parameters:
      id - The id of the record to find. Must not be null.
      entityClass - The class to get entity properties from (such as expiration). Must not be null.
      targetClass - The class to map the record to. Must not be null.
      setName - Set name to find the document from.
      Returns:
      The record mapped to targetClass's type or null if document doesn't exist.
    • findByIds

      public <T> List<T> findByIds(Iterable<?> ids, Class<T> entityClass)
      Description copied from interface: AerospikeOperations
      Find records by ids using a single batch read operation, set name will be determined by the given entityClass.

      The records will be mapped to the given entityClass.

      Specified by:
      findByIds in interface AerospikeOperations
      Parameters:
      ids - The ids of the documents to find. Must not be null.
      entityClass - The class to extract set name from and to map the records to. Must not be null.
      Returns:
      The matching records mapped to entityClass's type, if no document exists, an empty list is returned.
    • findByIds

      public <T> List<T> findByIds(Iterable<?> ids, Class<T> entityClass, String setName)
      Description copied from interface: AerospikeOperations
      Find records by ids within the given set using a single batch read operation.

      The records will be mapped to the given entityClass.

      Specified by:
      findByIds in interface AerospikeOperations
      Parameters:
      ids - The ids of the documents to find. Must not be null.
      entityClass - The class to map the records to. Must not be null.
      setName - Set name to use.
      Returns:
      The matching records mapped to entityClass's type or an empty list if nothing found.
    • findByIds

      public <T, S> List<S> findByIds(Iterable<?> ids, Class<T> entityClass, Class<S> targetClass)
      Description copied from interface: AerospikeOperations
      Find records by ids using a single batch read operation, set name will be determined by the given entityClass.

      The records will be mapped to the given targetClass.

      Specified by:
      findByIds in interface AerospikeOperations
      Parameters:
      ids - The ids of the documents to find. Must not be null.
      entityClass - The class to extract set name from. Must not be null.
      targetClass - The class to map the record to. Must not be null.
      Returns:
      The matching records mapped to targetClass's type or an empty list if nothing found.
    • findByIds

      public <T, S> List<S> findByIds(Iterable<?> ids, Class<T> entityClass, Class<S> targetClass, String setName)
      Description copied from interface: AerospikeOperations
      Find records by ids within the given set using a single batch read operation.

      The records will be mapped to the given targetClass.

      Specified by:
      findByIds in interface AerospikeOperations
      Parameters:
      ids - The ids of the documents to find. Must not be null.
      entityClass - The class to get entity properties from (such as expiration). Must not be null.
      targetClass - The class to map the record to. Must not be null.
      setName - Set name to use.
      Returns:
      The matching records mapped to targetClass's type or an empty list if nothing found.
    • findByIds

      public GroupedEntities findByIds(GroupedKeys groupedKeys)
      Description copied from interface: AerospikeOperations
      Execute a single batch request to find several records, possibly from different sets.

      Aerospike provides functionality to get records from different sets in 1 batch request. This method receives keys grouped by document type as a parameter and returns Aerospike records mapped to documents grouped by type.

      Specified by:
      findByIds in interface AerospikeOperations
      Parameters:
      groupedKeys - Keys grouped by document type. Must not be null, groupedKeys.getEntitiesKeys() must not be null.
      Returns:
      grouped documents.
    • findByIdUsingQuery

      public <T, S> Object findByIdUsingQuery(Object id, Class<T> entityClass, Class<S> targetClass, Query query)
      Description copied from interface: AerospikeOperations
      Find a record by id using a query, set name will be determined by the given entityClass.

      The record will be mapped to the given targetClass.

      Specified by:
      findByIdUsingQuery in interface AerospikeOperations
      Parameters:
      id - The id of the record to find. Must not be null.
      entityClass - The class to extract set name from. Must not be null.
      targetClass - The class to map the record to.
      query - The Query to filter results. Optional argument (null if no filtering required).
      Returns:
      The matching record mapped to targetClass's type.
    • findByIdUsingQuery

      public <T, S> Object findByIdUsingQuery(Object id, Class<T> entityClass, Class<S> targetClass, String setName, Query query)
      Description copied from interface: AerospikeOperations
      Find a record by id within the given set using a query.

      The record will be mapped to the given targetClass.

      Specified by:
      findByIdUsingQuery in interface AerospikeOperations
      Parameters:
      id - The id of the record to find. Must not be null.
      entityClass - The class to get the entity properties from (such as expiration). Must not be null.
      targetClass - The class to map the record to.
      setName - Set name to use.
      query - The Query to filter results. Optional argument (null if no filtering required).
      Returns:
      The matching record mapped to targetClass's type.
    • findByIdsUsingQuery

      public <T, S> List<?> findByIdsUsingQuery(Collection<?> ids, Class<T> entityClass, Class<S> targetClass, Query query)
      Description copied from interface: AerospikeOperations
      Find records by ids and a query, set name will be determined by the given entityClass.

      The records will be mapped to the given targetClass.

      Specified by:
      findByIdsUsingQuery in interface AerospikeOperations
      Parameters:
      ids - The ids of the documents to find. Must not be null.
      entityClass - The class to extract set name from. Must not be null.
      targetClass - The class to map the record to.
      query - The Query to filter results. Optional argument (null if no filtering required).
      Returns:
      The matching records mapped to targetClass's type if provided (otherwise to entityClass's type), or an empty list if no documents found.
    • findByIdsUsingQuery

      public <T, S> List<?> findByIdsUsingQuery(Collection<?> ids, Class<T> entityClass, Class<S> targetClass, String setName, Query query)
      Description copied from interface: AerospikeOperations
      Find records by ids within the given set.

      The records will be mapped to the given targetClass.

      Specified by:
      findByIdsUsingQuery in interface AerospikeOperations
      Parameters:
      ids - The ids of the documents to find. Must not be null.
      entityClass - The class to get the entity properties from (such as expiration). Must not be null.
      targetClass - The class to map the record to.
      setName - Set name to use.
      query - The Query to filter results. Optional argument (null if no filtering required).
      Returns:
      The matching records mapped to targetClass's type if provided (otherwise to entityClass's type), or an empty list if no documents found.
    • find

      public <T> Stream<T> find(Query query, Class<T> entityClass)
      Description copied from interface: AerospikeOperations
      Find records in the given entityClass's set using a query and map them to the given class type.
      Specified by:
      find in interface AerospikeOperations
      Parameters:
      query - The Query to filter results. Must not be null.
      entityClass - The class to extract set name from and to map the records to. Must not be null.
      Returns:
      A Stream of matching records mapped to entityClass type.
    • find

      public <T, S> Stream<S> find(Query query, Class<T> entityClass, Class<S> targetClass)
      Description copied from interface: AerospikeOperations
      Find records in the given entityClass's set using a query and map them to the given target class type.
      Specified by:
      find in interface AerospikeOperations
      Parameters:
      query - The Query to filter results. Must not be null.
      entityClass - The class to extract set name from. Must not be null.
      targetClass - The class to map the record to. Must not be null.
      Returns:
      A Stream of matching records mapped to targetClass type.
    • find

      public <T> Stream<T> find(Query query, Class<T> targetClass, String setName)
      Description copied from interface: AerospikeOperations
      Find records in the given set using a query and map them to the given target class type.
      Specified by:
      find in interface AerospikeOperations
      Parameters:
      query - The Query to filter results. Must not be null.
      targetClass - The class to map the record to. Must not be null.
      setName - Set name to use.
      Returns:
      A Stream of matching records mapped to targetClass type.
    • findAll

      public <T> Stream<T> findAll(Class<T> entityClass)
      Description copied from interface: AerospikeOperations
      Find all records in the given entityClass's set and map them to the given class type.
      Specified by:
      findAll in interface AerospikeOperations
      Parameters:
      entityClass - The class to extract set name from and to map the records to. Must not be null.
      Returns:
      A Stream of matching records mapped to entityClass type.
    • findAll

      public <T, S> Stream<S> findAll(Class<T> entityClass, Class<S> targetClass)
      Description copied from interface: AerospikeOperations
      Find all records in the given entityClass's set and map them to the given target class type.
      Specified by:
      findAll in interface AerospikeOperations
      Parameters:
      entityClass - The class to extract set name from. Must not be null.
      targetClass - The class to map the record to. Must not be null.
      Returns:
      A Stream of matching records mapped to targetClass type.
    • findAll

      public <T> Stream<T> findAll(Class<T> targetClass, String setName)
      Description copied from interface: AerospikeOperations
      Find all records in the given set and map them to the given class type.
      Specified by:
      findAll in interface AerospikeOperations
      Parameters:
      targetClass - The class to map the records to. Must not be null.
      setName - Set name to use.
      Returns:
      A Stream of matching records mapped to entityClass type.
    • findAll

      public <T> Stream<T> findAll(Sort sort, long offset, long limit, Class<T> entityClass)
      Description copied from interface: AerospikeOperations
      Find all records in the given entityClass's set using a provided sort and map them to the given class type.
      Specified by:
      findAll in interface AerospikeOperations
      Parameters:
      sort - The sort to affect the returned iterable documents order.
      offset - The offset to start the range from.
      limit - The limit of the range.
      entityClass - The class to extract set name from and to map the records to.
      Returns:
      A Stream of matching records mapped to entityClass type.
    • findAll

      public <T, S> Stream<S> findAll(Sort sort, long offset, long limit, Class<T> entityClass, Class<S> targetClass)
      Description copied from interface: AerospikeOperations
      Find all records in the given entityClass's set using a provided sort and map them to the given target class type.
      Specified by:
      findAll in interface AerospikeOperations
      Parameters:
      sort - The sort to affect the returned iterable documents order.
      offset - The offset to start the range from.
      limit - The limit of the range.
      entityClass - The class to extract set name from.
      targetClass - The class to map the record to. Must not be null.
      Returns:
      A Stream of matching records mapped to targetClass type.
    • findAll

      public <T> Stream<T> findAll(Sort sort, long offset, long limit, Class<T> targetClass, String setName)
      Description copied from interface: AerospikeOperations
      Find all records in the given set using a provided sort and map them to the given target class type.
      Specified by:
      findAll in interface AerospikeOperations
      Parameters:
      sort - The sort to affect the returned iterable documents order.
      offset - The offset to start the range from.
      limit - The limit of the range.
      targetClass - The class to map the record to. Must not be null.
      setName - Set name to use.
      Returns:
      A Stream of matching records mapped to targetClass type.
    • findUsingQueryWithoutPostProcessing

      public <T, S> Stream<S> findUsingQueryWithoutPostProcessing(Class<T> entityClass, Class<S> targetClass, Query query)
      Description copied from interface: AerospikeOperations
      Find records in the given entityClass set using a query and map them to the given target class type. If the query has pagination and/or sorting, post-processing must be applied separately.
      Specified by:
      findUsingQueryWithoutPostProcessing in interface AerospikeOperations
      Parameters:
      entityClass - The class to extract set name from. Must not be null.
      targetClass - The class to map the records to.
      query - The Query to filter results.
      Returns:
      A Stream of all matching records (regardless of pagination/sorting) mapped to targetClass type.
    • findInRange

      public <T> Stream<T> findInRange(long offset, long limit, Sort sort, Class<T> entityClass)
      Description copied from interface: AerospikeOperations
      Find records in the given entityClass's set using a range (offset, limit) and a sort and map them to the given class type.
      Specified by:
      findInRange in interface AerospikeOperations
      Parameters:
      offset - The offset to start the range from.
      limit - The limit of the range.
      sort - The sort to affect the order of the returned Stream of documents.
      entityClass - The class to extract set name from and to map the records to. Must not be null.
      Returns:
      A Stream of matching records mapped to entityClass type.
    • findInRange

      public <T, S> Stream<S> findInRange(long offset, long limit, Sort sort, Class<T> entityClass, Class<S> targetClass)
      Description copied from interface: AerospikeOperations
      Find records in the given entityClass's set using a range (offset, limit) and a sort and map them to the given target class type.
      Specified by:
      findInRange in interface AerospikeOperations
      Parameters:
      offset - The offset to start the range from.
      limit - The limit of the range.
      sort - The sort to affect the returned Stream of documents order.
      entityClass - The class to extract set name from. Must not be null.
      targetClass - The class to map the record to. Must not be null.
      Returns:
      A Stream of matching records mapped to targetClass type.
    • findInRange

      public <T> Stream<T> findInRange(long offset, long limit, Sort sort, Class<T> targetClass, String setName)
      Description copied from interface: AerospikeOperations
      Find records in the given set using a range (offset, limit) and a sort and map them to the given target class type.
      Specified by:
      findInRange in interface AerospikeOperations
      Parameters:
      offset - The offset to start the range from.
      limit - The limit of the range.
      sort - The sort to affect the returned Stream of documents order.
      targetClass - The class to map the record to. Must not be null.
      setName - Set name to use.
      Returns:
      A Stream of matching records mapped to targetClass type.
    • exists

      public <T> boolean exists(Object id, Class<T> entityClass)
      Description copied from interface: AerospikeOperations
      Check by id if a record exists within the set associated with the given entityClass.
      Specified by:
      exists in interface AerospikeOperations
      Parameters:
      id - The id to check for record existence. Must not be null.
      entityClass - The class to extract set name from. Must not be null.
      Returns:
      whether the matching record exists.
    • exists

      public boolean exists(Object id, String setName)
      Description copied from interface: AerospikeOperations
      Check by id if a record exists within the given set name.
      Specified by:
      exists in interface AerospikeOperations
      Parameters:
      id - The id to check for record existence. Must not be null.
      setName - Set name to use.
      Returns:
      whether the matching record exists.
    • existsByQuery

      public <T> boolean existsByQuery(Query query, Class<T> entityClass)
      Description copied from interface: AerospikeOperations
      Check using a query if any matching records exist within the set associated with the given entityClass.
      Specified by:
      existsByQuery in interface AerospikeOperations
      Parameters:
      query - The query to check if any matching records exist. Must not be null.
      entityClass - The class to extract set name from. Must not be null.
      Returns:
      whether any matching records exist.
    • existsByQuery

      public <T> boolean existsByQuery(Query query, Class<T> entityClass, String setName)
      Description copied from interface: AerospikeOperations
      Check using a query if any matching records exist within the given set.
      Specified by:
      existsByQuery in interface AerospikeOperations
      Parameters:
      query - The query to check if any matching records exist. Must not be null.
      entityClass - The class to translate to returned records into. Must not be null.
      setName - Set name to use. Must not be null.
      Returns:
      whether any matching records exist.
    • count

      public <T> long count(Class<T> entityClass)
      Description copied from interface: AerospikeOperations
      Return the amount of records in the set determined by the given entityClass.
      Specified by:
      count in interface AerospikeOperations
      Parameters:
      entityClass - The class to extract set name from. Must not be null.
      Returns:
      amount of records in the set of the given entityClass.
    • count

      public long count(String setName)
      Description copied from interface: AerospikeOperations
      Return the amount of records in the given Aerospike set.
      Specified by:
      count in interface AerospikeOperations
      Parameters:
      setName - The name of the set to count. Must not be null.
      Returns:
      amount of records in the given set.
    • count

      public <T> long count(Query query, Class<T> entityClass)
      Description copied from interface: AerospikeOperations
      Return the amount of records in query results. Set name will be determined by the given entityClass.
      Specified by:
      count in interface AerospikeOperations
      Parameters:
      query - The query that provides the result set for count.
      entityClass - The class to extract set name from. Must not be null.
      Returns:
      amount of records matching the given query and entity class.
    • count

      public long count(Query query, String setName)
      Description copied from interface: AerospikeOperations
      Return the amount of records in query results within the given set.
      Specified by:
      count in interface AerospikeOperations
      Parameters:
      query - The query that provides the result set for count.
      setName - Set name to use.
      Returns:
      amount of documents matching the given query and set.
    • aggregate

      public <T> com.aerospike.client.query.ResultSet aggregate(com.aerospike.client.query.Filter filter, Class<T> entityClass, String module, String function, List<com.aerospike.client.Value> arguments)
      Description copied from interface: AerospikeOperations
      Execute query, apply statement's aggregation function, and return result iterator.
      Specified by:
      aggregate in interface AerospikeOperations
      Parameters:
      filter - The filter to pass to the query.
      entityClass - The class to extract set name from. Must not be null.
      module - server package where user defined function resides.
      function - aggregation function name.
      arguments - arguments to pass to function name, if any.
      Returns:
      Result iterator.
    • aggregate

      public com.aerospike.client.query.ResultSet aggregate(com.aerospike.client.query.Filter filter, String setName, String module, String function, List<com.aerospike.client.Value> arguments)
      Description copied from interface: AerospikeOperations
      Execute query within the given set, apply statement's aggregation function, and return result iterator.
      Specified by:
      aggregate in interface AerospikeOperations
      Parameters:
      filter - The filter to pass to the query.
      setName - Set name to use.
      module - server package where user defined function resides.
      function - aggregation function name.
      arguments - arguments to pass to function name, if any.
      Returns:
      Result iterator.
    • createIndex

      public <T> void createIndex(Class<T> entityClass, String indexName, String binName, com.aerospike.client.query.IndexType indexType)
      Description copied from interface: AerospikeOperations
      Create an index with the specified name in Aerospike.
      Specified by:
      createIndex in interface AerospikeOperations
      Parameters:
      entityClass - The class to extract set name from. Must not be null.
      indexName - The index name. Must not be null.
      binName - The bin name to create the index on. Must not be null.
      indexType - The type of the index. Must not be null.
    • createIndex

      public <T> void createIndex(Class<T> entityClass, String indexName, String binName, com.aerospike.client.query.IndexType indexType, com.aerospike.client.query.IndexCollectionType indexCollectionType)
      Description copied from interface: AerospikeOperations
      Create an index with the specified name in Aerospike.
      Specified by:
      createIndex in interface AerospikeOperations
      Parameters:
      entityClass - The class to extract set name from. Must not be null.
      indexName - The index name. Must not be null.
      binName - The bin name to create the index on. Must not be null.
      indexType - The type of the index. Must not be null.
      indexCollectionType - The collection type of the index. Must not be null.
    • createIndex

      public <T> void createIndex(Class<T> entityClass, String indexName, String binName, com.aerospike.client.query.IndexType indexType, com.aerospike.client.query.IndexCollectionType indexCollectionType, com.aerospike.client.cdt.CTX... ctx)
      Description copied from interface: AerospikeOperations
      Create an index with the specified name in Aerospike.
      Specified by:
      createIndex in interface AerospikeOperations
      Parameters:
      entityClass - The class to extract set name from. Must not be null.
      indexName - The index name. Must not be null.
      binName - The bin name to create the index on. Must not be null.
      indexType - The type of the index. Must not be null.
      indexCollectionType - The collection type of the index. Must not be null.
      ctx - optional context to index on elements within a CDT.
    • createIndex

      public void createIndex(String setName, String indexName, String binName, com.aerospike.client.query.IndexType indexType)
      Description copied from interface: AerospikeOperations
      Create an index with the specified name in Aerospike.
      Specified by:
      createIndex in interface AerospikeOperations
      Parameters:
      setName - Set name to use.
      indexName - The index name. Must not be null.
      binName - The bin name to create the index on. Must not be null.
      indexType - The type of the index. Must not be null.
    • createIndex

      public void createIndex(String setName, String indexName, String binName, com.aerospike.client.query.IndexType indexType, com.aerospike.client.query.IndexCollectionType indexCollectionType)
      Description copied from interface: AerospikeOperations
      Create an index with the specified name in Aerospike.
      Specified by:
      createIndex in interface AerospikeOperations
      Parameters:
      setName - Set name to use.
      indexName - The index name. Must not be null.
      binName - The bin name to create the index on. Must not be null.
      indexType - The type of the index. Must not be null.
      indexCollectionType - The collection type of the index. Must not be null.
    • createIndex

      public void createIndex(String setName, String indexName, String binName, com.aerospike.client.query.IndexType indexType, com.aerospike.client.query.IndexCollectionType indexCollectionType, com.aerospike.client.cdt.CTX... ctx)
      Description copied from interface: AerospikeOperations
      Create an index with the specified name in Aerospike.
      Specified by:
      createIndex in interface AerospikeOperations
      Parameters:
      setName - Set name to use.
      indexName - The index name. Must not be null.
      binName - The bin name to create the index on. Must not be null.
      indexType - The type of the index. Must not be null.
      indexCollectionType - The collection type of the index. Must not be null.
      ctx - optional context to index on elements within a CDT.
    • deleteIndex

      public <T> void deleteIndex(Class<T> entityClass, String indexName)
      Description copied from interface: AerospikeOperations
      Delete an index with the specified name in Aerospike.
      Specified by:
      deleteIndex in interface AerospikeOperations
      Parameters:
      entityClass - The class to extract set name from. Must not be null.
      indexName - The index name. Must not be null.
    • deleteIndex

      public void deleteIndex(String setName, String indexName)
      Description copied from interface: AerospikeOperations
      Delete an index with the specified name within the given set in Aerospike.
      Specified by:
      deleteIndex in interface AerospikeOperations
      Parameters:
      setName - Set name to use.
      indexName - The index name. Must not be null.
    • indexExists

      public boolean indexExists(String indexName)
      Description copied from interface: AerospikeOperations
      Check whether an index with the specified name exists in Aerospike.
      Specified by:
      indexExists in interface AerospikeOperations
      Parameters:
      indexName - The Aerospike index name. Must not be null.
      Returns:
      true if exists
    • getSetName

      public <T> String getSetName(Class<T> entityClass)
    • getSetName

      public <T> String getSetName(T document)
    • getMappingContext

      public MappingContext<?,?> getMappingContext()
    • getAerospikeConverter

      public MappingAerospikeConverter getAerospikeConverter()
    • getNamespace

      public String getNamespace()
    • getBatchWriteForSave

      public <T> org.springframework.data.aerospike.core.BaseAerospikeTemplate.BatchWriteData<T> getBatchWriteForSave(T document, String setName)
    • getBatchWriteForInsert

      public <T> org.springframework.data.aerospike.core.BaseAerospikeTemplate.BatchWriteData<T> getBatchWriteForInsert(T document, String setName)
    • getBatchWriteForUpdate

      public <T> org.springframework.data.aerospike.core.BaseAerospikeTemplate.BatchWriteData<T> getBatchWriteForUpdate(T document, String setName)
    • getBatchWriteForDelete

      public <T> org.springframework.data.aerospike.core.BaseAerospikeTemplate.BatchWriteData<T> getBatchWriteForDelete(T document, String setName)