public interface AsyncCassandraOperations
AsyncCassandraTemplate.
Not often used directly, but a useful option to enhance testability, as it can easily be mocked or stubbed.AsyncCassandraTemplate,
AsyncCqlOperations,
Statement,
InsertOptions,
UpdateOptions| Modifier and Type | Method and Description |
|---|---|
ListenableFuture<Long> |
count(Class<?> entityClass)
Returns the number of rows for the given entity class.
|
ListenableFuture<Long> |
count(Query query,
Class<?> entityClass)
Returns the number of rows for the given entity class applying
Query. |
ListenableFuture<WriteResult> |
delete(Object entity,
QueryOptions options)
Delete the given entity applying
QueryOptions and return the entity if the delete was applied. |
ListenableFuture<Boolean> |
delete(Query query,
Class<?> entityClass)
Remove entities (rows)/columns from the table by
Query. |
<T> ListenableFuture<T> |
delete(T entity)
Delete the given entity and return the entity if the delete was applied.
|
ListenableFuture<Boolean> |
deleteById(Object id,
Class<?> entityClass)
Remove the given object from the table by id.
|
ListenableFuture<Boolean> |
exists(Object id,
Class<?> entityClass)
Determine whether a row of
entityClass with the given id exists. |
ListenableFuture<Boolean> |
exists(Query query,
Class<?> entityClass)
Determine whether the result for
entityClass Query yields at least one row. |
AsyncCqlOperations |
getAsyncCqlOperations()
Expose the underlying
AsyncCqlOperations to allow asynchronous CQL operations. |
CassandraConverter |
getConverter()
Returns the underlying
CassandraConverter. |
<T> ListenableFuture<T> |
insert(T entity)
Insert the given entity and return the entity if the insert was applied.
|
<T> ListenableFuture<EntityWriteResult<T>> |
insert(T entity,
InsertOptions options)
Insert the given entity applying
WriteOptions and return the entity if the insert was applied. |
<T> ListenableFuture<List<T>> |
select(Query query,
Class<T> entityClass)
Execute a
SELECT query and convert the resulting items to a List of entities. |
<T> ListenableFuture<Void> |
select(Query query,
Consumer<T> entityConsumer,
Class<T> entityClass)
Execute a
SELECT query and convert the resulting items notifying Consumer for each entity. |
<T> ListenableFuture<List<T>> |
select(com.datastax.driver.core.Statement statement,
Class<T> entityClass)
Execute a
SELECT query and convert the resulting items to a List of entities. |
<T> ListenableFuture<Void> |
select(com.datastax.driver.core.Statement statement,
Consumer<T> entityConsumer,
Class<T> entityClass)
Execute a
SELECT query and convert the resulting items notifying Consumer for each entity. |
<T> ListenableFuture<List<T>> |
select(String cql,
Class<T> entityClass)
Execute a
SELECT query and convert the resulting items to a List of entities. |
<T> ListenableFuture<Void> |
select(String cql,
Consumer<T> entityConsumer,
Class<T> entityClass)
Execute a
SELECT query and convert the resulting items notifying Consumer for each entity. |
<T> ListenableFuture<T> |
selectOne(Query query,
Class<T> entityClass)
Execute a
SELECT query and convert the resulting item to an entity. |
<T> ListenableFuture<T> |
selectOne(com.datastax.driver.core.Statement statement,
Class<T> entityClass)
Execute a
SELECT query and convert the resulting item to an entity. |
<T> ListenableFuture<T> |
selectOne(String cql,
Class<T> entityClass)
Execute a
SELECT query and convert the resulting item to an entity. |
<T> ListenableFuture<T> |
selectOneById(Object id,
Class<T> entityClass)
Execute the Select by
id for the given entityClass. |
<T> ListenableFuture<Slice<T>> |
slice(Query query,
Class<T> entityClass)
Execute a
SELECT query with paging and convert the result set to a Slice of entities. |
<T> ListenableFuture<Slice<T>> |
slice(com.datastax.driver.core.Statement statement,
Class<T> entityClass)
Execute a
SELECT query with paging and convert the result set to a Slice of entities. |
ListenableFuture<Void> |
truncate(Class<?> entityClass)
Execute a
TRUNCATE query to remove all entities of a given class. |
ListenableFuture<Boolean> |
update(Query query,
Update update,
Class<?> entityClass)
Update the queried entities and return true if the update was applied.
|
<T> ListenableFuture<T> |
update(T entity)
Update the given entity and return the entity if the update was applied.
|
<T> ListenableFuture<EntityWriteResult<T>> |
update(T entity,
UpdateOptions options)
Update the given entity applying
WriteOptions and return the entity if the update was applied. |
AsyncCqlOperations getAsyncCqlOperations()
AsyncCqlOperations to allow asynchronous CQL operations.AsyncCqlOperations.AsyncCqlOperationsCassandraConverter getConverter()
CassandraConverter.CassandraConverter.<T> ListenableFuture<List<T>> select(String cql, Class<T> entityClass) throws DataAccessException
SELECT query and convert the resulting items to a List of entities.cql - must not be null.entityClass - The entity type must not be null.DataAccessException - if there is any problem executing the query.<T> ListenableFuture<Void> select(String cql, Consumer<T> entityConsumer, Class<T> entityClass) throws DataAccessException
SELECT query and convert the resulting items notifying Consumer for each entity.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.DataAccessException - if there is any problem executing the query.<T> ListenableFuture<T> selectOne(String cql, Class<T> entityClass) throws DataAccessException
SELECT query and convert the resulting item to an entity.cql - must not be null.entityClass - The entity type must not be null.DataAccessException - if there is any problem executing the query.<T> ListenableFuture<List<T>> select(com.datastax.driver.core.Statement statement, Class<T> entityClass) throws DataAccessException
SELECT query and convert the resulting items to a List of entities.statement - must not be null.entityClass - The entity type must not be null.DataAccessException - if there is any problem executing the query.<T> ListenableFuture<Slice<T>> slice(com.datastax.driver.core.Statement statement, Class<T> entityClass) throws DataAccessException
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.statement - the CQL statement, must not be null.entityClass - The entity type must not be null.DataAccessException - if there is any problem executing the query.CassandraPageRequest<T> ListenableFuture<Void> select(com.datastax.driver.core.Statement statement, Consumer<T> entityConsumer, Class<T> entityClass) throws DataAccessException
SELECT query and convert the resulting items notifying Consumer for each entity.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.DataAccessException - if there is any problem executing the query.<T> ListenableFuture<T> selectOne(com.datastax.driver.core.Statement statement, Class<T> entityClass) throws DataAccessException
SELECT query and convert the resulting item to an entity.statement - must not be null.entityClass - The entity type must not be null.DataAccessException - if there is any problem executing the query.<T> ListenableFuture<List<T>> select(Query query, Class<T> entityClass) throws DataAccessException
SELECT query and convert the resulting items to a List of entities.query - must not be null.entityClass - The entity type must not be null.DataAccessException - if there is any problem executing the query.<T> ListenableFuture<Slice<T>> slice(Query query, Class<T> entityClass) throws DataAccessException
SELECT query with paging and convert the result set to a Slice of entities.query - the query object used to create a CQL statement, must not be null.entityClass - The entity type must not be null.DataAccessException - if there is any problem executing the query.CassandraPageRequest<T> ListenableFuture<Void> select(Query query, Consumer<T> entityConsumer, Class<T> entityClass) throws DataAccessException
SELECT query and convert the resulting items notifying Consumer for each entity.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.DataAccessException - if there is any problem executing the query.<T> ListenableFuture<T> selectOne(Query query, Class<T> entityClass) throws DataAccessException
SELECT query and convert the resulting item to an entity.query - must not be null.entityClass - The entity type must not be null.DataAccessException - if there is any problem executing the query.ListenableFuture<Boolean> update(Query query, Update update, Class<?> entityClass) throws DataAccessException
query - must not be null.update - must not be null.entityClass - The entity type must not be null.DataAccessException - if there is any problem executing the query.ListenableFuture<Boolean> delete(Query query, Class<?> entityClass) throws DataAccessException
Query.query - must not be null.entityClass - The entity type must not be null.DataAccessException - if there is any problem executing the query.ListenableFuture<Long> count(Class<?> entityClass) throws DataAccessException
entityClass - type of the entity; must not be null.DataAccessException - if any problem occurs while executing the query.ListenableFuture<Long> count(Query query, Class<?> entityClass) throws DataAccessException
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.query - user-provided count Query to execute; must not be null.entityClass - type of the entity; must not be null.DataAccessException - if any problem occurs while executing the query.ListenableFuture<Boolean> exists(Object id, Class<?> entityClass) throws DataAccessException
entityClass with the given id exists.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.DataAccessException - if any problem occurs while executing the query.ListenableFuture<Boolean> exists(Query query, Class<?> entityClass) throws DataAccessException
entityClass Query yields at least one row.query - user-provided exists Query to execute; must not be null.entityClass - type of the entity; must not be null.DataAccessException - if any problem occurs while executing the query.<T> ListenableFuture<T> selectOneById(Object id, Class<T> entityClass) throws DataAccessException
id for the given entityClass.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.DataAccessException - if there is any problem executing the query.<T> ListenableFuture<T> insert(T entity) throws DataAccessException
entity - The entity to insert, must not be null.DataAccessException - if there is any problem executing the query.<T> ListenableFuture<EntityWriteResult<T>> insert(T entity, InsertOptions options) throws DataAccessException
WriteOptions and return the entity if the insert was applied.entity - The entity to insert, must not be null.options - must not be null.EntityWriteResult for this operation.DataAccessException - if there is any problem executing the query.InsertOptions.empty()<T> ListenableFuture<T> update(T entity) throws DataAccessException
entity - The entity to update, must not be null.DataAccessException - if there is any problem executing the query.<T> ListenableFuture<EntityWriteResult<T>> update(T entity, UpdateOptions options) throws DataAccessException
WriteOptions and return the entity if the update was applied.entity - The entity to update, must not be null.options - must not be null.EntityWriteResult for this operation.DataAccessException - if there is any problem executing the query.UpdateOptions.empty()<T> ListenableFuture<T> delete(T entity) throws DataAccessException
entity - must not be null.DataAccessException - if there is any problem executing the query.ListenableFuture<WriteResult> delete(Object entity, QueryOptions options) throws DataAccessException
QueryOptions and return the entity if the delete was applied.entity - must not be null.options - must not be null.WriteResult for this operation.DataAccessException - if there is any problem executing the query.QueryOptions.empty()ListenableFuture<Boolean> deleteById(Object id, Class<?> entityClass) throws DataAccessException
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.DataAccessException - if there is any problem executing the query.ListenableFuture<Void> truncate(Class<?> entityClass) throws DataAccessException
TRUNCATE query to remove all entities of a given class.entityClass - The entity type must not be null.DataAccessException - if there is any problem executing the query.Copyright © 2011–2018 Pivotal Software, Inc.. All rights reserved.