Interface AsyncCassandraOperations

All Known Implementing Classes:
AsyncCassandraTemplate

@Deprecated(since="4.0", forRemoval=true) public interface AsyncCassandraOperations
Deprecated, for removal: This API element is subject to removal in a future version.
since 4.0, use the CompletableFuture-based variant AsyncCassandraTemplate.
Interface specifying a basic set of asynchronous Cassandra operations. Implemented by AsyncCassandraTemplate. Not often used directly, but a useful option to enhance testability, as it can easily be mocked or stubbed.
Since:
4.0
Author:
Mark Paluch, John Blum
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    count(Class<?> entityClass)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Returns the number of rows for the given entity class.
    count(Query query, Class<?> entityClass)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Returns the number of rows for the given entity class applying Query.
    delete(Object entity, QueryOptions options)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Delete the given entity applying QueryOptions and return the entity if the delete statement was applied.
    delete(Object entity, DeleteOptions options)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Delete the given entity applying DeleteOptions and return the entity if the delete statement was applied.
    delete(Query query, Class<?> entityClass)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Remove entities (rows)/columns from the table by Query.
    delete(T entity)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Delete the given entity and return the entity if the delete statement was applied.
    deleteById(Object id, Class<?> entityClass)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Remove the given object from the table by id.
    ListenableFuture<com.datastax.oss.driver.api.core.cql.AsyncResultSet>
    execute(com.datastax.oss.driver.api.core.cql.Statement<?> statement)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Execute the given Cassandra Statement.
    exists(Object id, Class<?> entityClass)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Determine whether a row of entityClass with the given id exists.
    exists(Query query, Class<?> entityClass)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Determine whether the result for entityClass Query yields at least one row.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Expose the underlying AsyncCqlOperations to allow asynchronous CQL operations.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Returns the underlying CassandraConverter.
    insert(T entity)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Insert the given entity and return the entity if the insert was applied.
    insert(T entity, InsertOptions options)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Insert the given entity applying WriteOptions and return the entity if the insert was applied.
    select(com.datastax.oss.driver.api.core.cql.Statement<?> statement, Class<T> entityClass)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Execute a SELECT query and convert the resulting items to a List of entities.
    select(com.datastax.oss.driver.api.core.cql.Statement<?> statement, Consumer<T> entityConsumer, Class<T> entityClass)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Execute a SELECT query and convert the resulting items notifying Consumer for each entity.
    select(String cql, Class<T> entityClass)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Execute a SELECT query and convert the resulting items to a List of entities.
    select(String cql, Consumer<T> entityConsumer, Class<T> entityClass)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Execute a SELECT query and convert the resulting items notifying Consumer for each entity.
    select(Query query, Class<T> entityClass)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Execute a SELECT query and convert the resulting items to a List of entities.
    select(Query query, Consumer<T> entityConsumer, Class<T> entityClass)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Execute a SELECT query and convert the resulting items notifying Consumer for each entity.
    selectOne(com.datastax.oss.driver.api.core.cql.Statement<?> statement, Class<T> entityClass)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Execute a SELECT query and convert the resulting item to an entity.
    selectOne(String cql, Class<T> entityClass)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Execute a SELECT query and convert the resulting item to an entity.
    selectOne(Query query, Class<T> entityClass)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Execute a SELECT query and convert the resulting item to an entity.
    selectOneById(Object id, Class<T> entityClass)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Execute the Select by id for the given entityClass.
    slice(com.datastax.oss.driver.api.core.cql.Statement<?> statement, Class<T> entityClass)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Execute a SELECT query with paging and convert the result set to a Slice of entities.
    slice(Query query, Class<T> entityClass)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Execute a SELECT query with paging and convert the result set to a Slice of entities.
    truncate(Class<?> entityClass)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Execute a TRUNCATE query to remove all entities of a given class.
    update(Query query, Update update, Class<?> entityClass)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Update the queried entities and return true if the update was applied.
    update(T entity)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Update the given entity and return the entity if the update was applied.
    update(T entity, UpdateOptions options)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Update the given entity applying WriteOptions and return the entity if the update was applied.
  • Method Details

    • getAsyncCqlOperations

      AsyncCqlOperations getAsyncCqlOperations()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Expose the underlying AsyncCqlOperations to allow asynchronous CQL operations.
      Returns:
      the underlying AsyncCqlOperations.
      See Also:
    • getConverter

      CassandraConverter getConverter()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns the underlying CassandraConverter.
      Returns:
      the underlying CassandraConverter.
    • select

      <T> ListenableFuture<List<T>> select(String cql, Class<T> entityClass) throws DataAccessException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Execute a SELECT query and convert the resulting items to a List of entities.
      Parameters:
      cql - must not be null.
      entityClass - The entity type must not be null.
      Returns:
      the converted results
      Throws:
      DataAccessException - if there is any problem executing the query.
    • select

      <T> ListenableFuture<Void> select(String cql, Consumer<T> entityConsumer, Class<T> entityClass) throws DataAccessException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Execute a SELECT query and convert the resulting items notifying Consumer for each entity.
      Parameters:
      cql - must not be null.
      entityConsumer - object that will be notified on each entity, one object at a time, must not be null.
      entityClass - The entity type must not be null.
      Returns:
      the completion handle
      Throws:
      DataAccessException - if there is any problem executing the query.
    • selectOne

      <T> ListenableFuture<T> selectOne(String cql, Class<T> entityClass) throws DataAccessException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Execute a SELECT query and convert the resulting item to an entity.
      Parameters:
      cql - must not be null.
      entityClass - The entity type must not be null.
      Returns:
      the converted object or null.
      Throws:
      DataAccessException - if there is any problem executing the query.
    • execute

      ListenableFuture<com.datastax.oss.driver.api.core.cql.AsyncResultSet> execute(com.datastax.oss.driver.api.core.cql.Statement<?> statement) throws DataAccessException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Execute the given Cassandra Statement. Any errors that result from executing this command will be converted into Spring's DAO exception hierarchy.
      Parameters:
      statement - a Cassandra Statement, must not be null.
      Returns:
      the AsyncResultSet.
      Throws:
      DataAccessException - if there is any problem executing the query.
      Since:
      3.2
    • select

      <T> ListenableFuture<List<T>> select(com.datastax.oss.driver.api.core.cql.Statement<?> statement, Class<T> entityClass) throws DataAccessException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Execute a SELECT query and convert the resulting items to a List of entities.
      Parameters:
      statement - must not be null.
      entityClass - The entity type must not be null.
      Returns:
      the converted results
      Throws:
      DataAccessException - if there is any problem executing the query.
    • slice

      <T> ListenableFuture<Slice<T>> slice(com.datastax.oss.driver.api.core.cql.Statement<?> statement, Class<T> entityClass) throws DataAccessException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Execute a SELECT query with paging and convert the result set to a Slice of entities. A sliced query translates the effective fetch size to the page size.
      Parameters:
      statement - the CQL statement, must not be null.
      entityClass - The entity type must not be null.
      Returns:
      the converted results
      Throws:
      DataAccessException - if there is any problem executing the query.
      See Also:
    • select

      <T> ListenableFuture<Void> select(com.datastax.oss.driver.api.core.cql.Statement<?> statement, Consumer<T> entityConsumer, Class<T> entityClass) throws DataAccessException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Execute a SELECT query and convert the resulting items notifying Consumer for each entity.
      Parameters:
      statement - must not be null.
      entityConsumer - object that will be notified on each entity, one object at a time, must not be null.
      entityClass - The entity type must not be null.
      Returns:
      the completion handle
      Throws:
      DataAccessException - if there is any problem executing the query.
    • selectOne

      <T> ListenableFuture<T> selectOne(com.datastax.oss.driver.api.core.cql.Statement<?> statement, Class<T> entityClass) throws DataAccessException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Execute a SELECT query and convert the resulting item to an entity.
      Parameters:
      statement - must not be null.
      entityClass - The entity type must not be null.
      Returns:
      the converted object or null.
      Throws:
      DataAccessException - if there is any problem executing the query.
    • select

      <T> ListenableFuture<List<T>> select(Query query, Class<T> entityClass) throws DataAccessException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Execute a SELECT query and convert the resulting items to a List of entities.
      Parameters:
      query - must not be null.
      entityClass - The entity type must not be null.
      Returns:
      the converted results
      Throws:
      DataAccessException - if there is any problem executing the query.
    • slice

      <T> ListenableFuture<Slice<T>> slice(Query query, Class<T> entityClass) throws DataAccessException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Execute a SELECT query with paging and convert the result set to a Slice of entities.
      Parameters:
      query - the query object used to create a CQL statement, must not be null.
      entityClass - The entity type must not be null.
      Returns:
      the converted results
      Throws:
      DataAccessException - if there is any problem executing the query.
      See Also:
    • select

      <T> ListenableFuture<Void> select(Query query, Consumer<T> entityConsumer, Class<T> entityClass) throws DataAccessException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Execute a SELECT query and convert the resulting items notifying Consumer for each entity.
      Parameters:
      query - must not be null.
      entityConsumer - object that will be notified on each entity, one object at a time, must not be null.
      entityClass - The entity type must not be null.
      Returns:
      the completion handle
      Throws:
      DataAccessException - if there is any problem executing the query.
    • selectOne

      <T> ListenableFuture<T> selectOne(Query query, Class<T> entityClass) throws DataAccessException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Execute a SELECT query and convert the resulting item to an entity.
      Parameters:
      query - must not be null.
      entityClass - The entity type must not be null.
      Returns:
      the converted object or null.
      Throws:
      DataAccessException - if there is any problem executing the query.
    • update

      ListenableFuture<Boolean> update(Query query, Update update, Class<?> entityClass) throws DataAccessException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Update the queried entities and return true if the update was applied.
      Parameters:
      query - must not be null.
      update - must not be null.
      entityClass - The entity type must not be null.
      Throws:
      DataAccessException - if there is any problem executing the query.
    • delete

      ListenableFuture<Boolean> delete(Query query, Class<?> entityClass) throws DataAccessException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Remove entities (rows)/columns from the table by Query.
      Parameters:
      query - must not be null.
      entityClass - The entity type must not be null.
      Returns:
      true if the deletion was applied.
      Throws:
      DataAccessException - if there is any problem executing the query.
    • count

      ListenableFuture<Long> count(Class<?> entityClass) throws DataAccessException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns the number of rows for the given entity class.
      Parameters:
      entityClass - type of the entity; must not be null.
      Returns:
      the number of existing entities.
      Throws:
      DataAccessException - if any problem occurs while executing the query.
    • count

      ListenableFuture<Long> count(Query query, Class<?> entityClass) throws DataAccessException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns the number of rows for the given entity class applying Query. This overridden method allows users to further refine the selection criteria using a Query predicate to determine how many entities of the given type match the criteria.
      Parameters:
      query - user-provided count Query to execute; must not be null.
      entityClass - type of the entity; must not be null.
      Returns:
      the number of existing entities.
      Throws:
      DataAccessException - if any problem occurs while executing the query.
      Since:
      2.1
    • exists

      ListenableFuture<Boolean> exists(Object id, Class<?> entityClass) throws DataAccessException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Determine whether a row of entityClass with the given id exists.
      Parameters:
      id - Id value. For single primary keys it's the plain value. For composite primary keys either, it's an instance of either PrimaryKeyClass or MapId. Must not be null.
      entityClass - type of the entity; must not be null.
      Returns:
      true if the object exists.
      Throws:
      DataAccessException - if any problem occurs while executing the query.
    • exists

      ListenableFuture<Boolean> exists(Query query, Class<?> entityClass) throws DataAccessException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Determine whether the result for entityClass Query yields at least one row.
      Parameters:
      query - user-provided exists Query to execute; must not be null.
      entityClass - type of the entity; must not be null.
      Returns:
      true if the object exists.
      Throws:
      DataAccessException - if any problem occurs while executing the query.
      Since:
      2.1
    • selectOneById

      <T> ListenableFuture<T> selectOneById(Object id, Class<T> entityClass) throws DataAccessException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Execute the Select by id for the given entityClass.
      Parameters:
      id - the Id value. For single primary keys it's the plain value. For composite primary keys either the PrimaryKeyClass or MapId. Must not be null.
      entityClass - The entity type must not be null.
      Returns:
      the converted object or null.
      Throws:
      DataAccessException - if there is any problem executing the query.
    • insert

      <T> ListenableFuture<T> insert(T entity) throws DataAccessException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Insert the given entity and return the entity if the insert was applied.
      Parameters:
      entity - The entity to insert, must not be null.
      Returns:
      the inserted entity.
      Throws:
      DataAccessException - if there is any problem executing the query.
    • insert

      <T> ListenableFuture<EntityWriteResult<T>> insert(T entity, InsertOptions options) throws DataAccessException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Insert the given entity applying WriteOptions and return the entity if the insert was applied.
      Parameters:
      entity - The entity to insert, must not be null.
      options - must not be null.
      Returns:
      the EntityWriteResult for this operation.
      Throws:
      DataAccessException - if there is any problem executing the query.
      See Also:
    • update

      <T> ListenableFuture<T> update(T entity) throws DataAccessException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Update the given entity and return the entity if the update was applied.
      Parameters:
      entity - The entity to update, must not be null.
      Returns:
      the updated entity.
      Throws:
      DataAccessException - if there is any problem executing the query.
    • update

      <T> ListenableFuture<EntityWriteResult<T>> update(T entity, UpdateOptions options) throws DataAccessException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Update the given entity applying WriteOptions and return the entity if the update was applied.
      Parameters:
      entity - The entity to update, must not be null.
      options - must not be null.
      Returns:
      the EntityWriteResult for this operation.
      Throws:
      DataAccessException - if there is any problem executing the query.
      See Also:
    • delete

      <T> ListenableFuture<T> delete(T entity) throws DataAccessException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Delete the given entity and return the entity if the delete statement was applied.
      Parameters:
      entity - must not be null.
      Returns:
      the deleted entity.
      Throws:
      DataAccessException - if there is any problem executing the query.
    • delete

      Deprecated, for removal: This API element is subject to removal in a future version.
      Delete the given entity applying QueryOptions and return the entity if the delete statement was applied.
      Parameters:
      entity - must not be null.
      options - must not be null.
      Returns:
      the WriteResult for this operation.
      Throws:
      DataAccessException - if there is any problem executing the query.
      See Also:
    • delete

      default ListenableFuture<WriteResult> delete(Object entity, DeleteOptions options) throws DataAccessException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Delete the given entity applying DeleteOptions and return the entity if the delete statement was applied.
      Parameters:
      entity - must not be null.
      options - must not be null.
      Returns:
      the WriteResult for this operation.
      Throws:
      DataAccessException - if there is any problem executing the query.
      Since:
      2.2
      See Also:
    • deleteById

      ListenableFuture<Boolean> deleteById(Object id, Class<?> entityClass) throws DataAccessException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Remove the given object from the table by id.
      Parameters:
      id - the Id value. For single primary keys it's the plain value. For composite primary keys either the PrimaryKeyClass or MapId. Must not be null.
      entityClass - The entity type must not be null.
      Returns:
      true if the deletion was applied.
      Throws:
      DataAccessException - if there is any problem executing the query.
    • truncate

      ListenableFuture<Void> truncate(Class<?> entityClass) throws DataAccessException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Execute a TRUNCATE query to remove all entities of a given class.
      Parameters:
      entityClass - The entity type must not be null.
      Throws:
      DataAccessException - if there is any problem executing the query.