public interface ReactiveCassandraOperations extends ReactiveFluentCassandraOperations
ReactiveCassandraTemplate
.
Not often used directly, but a useful option to enhance testability, as it can easily be mocked or stubbed.ReactiveCassandraTemplate
,
ReactiveCqlOperations
,
Statement
,
InsertOptions
,
UpdateOptions
,
Flux
,
Mono
ReactiveSelectOperation.ReactiveSelect<T>, ReactiveSelectOperation.SelectWithProjection<T>, ReactiveSelectOperation.SelectWithQuery<T>, ReactiveSelectOperation.SelectWithTable<T>, ReactiveSelectOperation.TerminatingSelect<T>
ReactiveInsertOperation.InsertWithOptions<T>, ReactiveInsertOperation.InsertWithTable<T>, ReactiveInsertOperation.ReactiveInsert<T>, ReactiveInsertOperation.TerminatingInsert<T>
ReactiveUpdateOperation.ReactiveUpdate, ReactiveUpdateOperation.TerminatingUpdate, ReactiveUpdateOperation.UpdateWithQuery, ReactiveUpdateOperation.UpdateWithTable
ReactiveDeleteOperation.DeleteWithQuery, ReactiveDeleteOperation.DeleteWithTable, ReactiveDeleteOperation.ReactiveDelete, ReactiveDeleteOperation.TerminatingDelete
Modifier and Type | Method and Description |
---|---|
ReactiveCassandraBatchOperations |
batchOps()
Returns a new
ReactiveCassandraBatchOperations . |
reactor.core.publisher.Mono<Long> |
count(Class<?> entityClass)
Returns the number of rows for the given entity class.
|
reactor.core.publisher.Mono<Long> |
count(Query query,
Class<?> entityClass)
Returns the number of rows for the given entity class applying
Query . |
default reactor.core.publisher.Mono<WriteResult> |
delete(Object entity,
DeleteOptions options)
Delete the given entity applying
QueryOptions and emit the entity if the delete was applied. |
reactor.core.publisher.Mono<WriteResult> |
delete(Object entity,
QueryOptions options)
Delete the given entity applying
QueryOptions and emit the entity if the delete was applied. |
reactor.core.publisher.Mono<Boolean> |
delete(Query query,
Class<?> entityClass)
Remove entities (rows)/columns from the table by
Query . |
<T> reactor.core.publisher.Mono<T> |
delete(T entity)
Delete the given entity and emit the entity if the delete was applied.
|
reactor.core.publisher.Mono<Boolean> |
deleteById(Object id,
Class<?> entityClass)
Remove the given object from the table by id.
|
reactor.core.publisher.Mono<ReactiveResultSet> |
execute(com.datastax.oss.driver.api.core.cql.Statement<?> statement)
Execute the a Cassandra
Statement . |
reactor.core.publisher.Mono<Boolean> |
exists(Object id,
Class<?> entityClass)
Determine whether a row of
entityClass with the given id exists. |
reactor.core.publisher.Mono<Boolean> |
exists(Query query,
Class<?> entityClass)
Determine whether the result for
entityClass Query yields at least one row. |
CassandraConverter |
getConverter()
Returns the underlying
CassandraConverter . |
ReactiveCqlOperations |
getReactiveCqlOperations()
Expose the underlying
ReactiveCqlOperations to allow CQL operations. |
<T> reactor.core.publisher.Mono<T> |
insert(T entity)
Insert the given entity and emit the entity if the insert was applied.
|
<T> reactor.core.publisher.Mono<EntityWriteResult<T>> |
insert(T entity,
InsertOptions options)
Insert the given entity applying
WriteOptions and emit the entity if the insert was applied. |
<T> reactor.core.publisher.Flux<T> |
select(Query query,
Class<T> entityClass)
Execute a
SELECT query and convert the resulting items to a stream of entities. |
<T> reactor.core.publisher.Flux<T> |
select(com.datastax.oss.driver.api.core.cql.Statement<?> statement,
Class<T> entityClass)
Execute a
SELECT query and convert the resulting items to a stream of entities. |
<T> reactor.core.publisher.Flux<T> |
select(String cql,
Class<T> entityClass)
Execute a
SELECT query and convert the resulting items to a stream of entities. |
<T> reactor.core.publisher.Mono<T> |
selectOne(Query query,
Class<T> entityClass)
Execute a
SELECT query and convert the resulting item to an entity. |
<T> reactor.core.publisher.Mono<T> |
selectOne(com.datastax.oss.driver.api.core.cql.Statement<?> statement,
Class<T> entityClass)
Execute a
SELECT query and convert the resulting item to an entity. |
<T> reactor.core.publisher.Mono<T> |
selectOne(String cql,
Class<T> entityClass)
Execute a
SELECT query and convert the resulting item to an entity. |
<T> reactor.core.publisher.Mono<T> |
selectOneById(Object id,
Class<T> entityClass)
Execute the Select by
id for the given entityClass . |
<T> reactor.core.publisher.Mono<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> reactor.core.publisher.Mono<Slice<T>> |
slice(com.datastax.oss.driver.api.core.cql.Statement<?> statement,
Class<T> entityClass)
Execute a
SELECT query with paging and convert the result set to a Slice of entities. |
reactor.core.publisher.Mono<Void> |
truncate(Class<?> entityClass)
Execute a
TRUNCATE query to remove all entities of a given class. |
reactor.core.publisher.Mono<Boolean> |
update(Query query,
Update update,
Class<?> entityClass)
Update the queried entities and return true if the update was applied.
|
<T> reactor.core.publisher.Mono<T> |
update(T entity)
Update the given entity and emit the entity if the update was applied.
|
<T> reactor.core.publisher.Mono<EntityWriteResult<T>> |
update(T entity,
UpdateOptions options)
Update the given entity applying
WriteOptions and emit the entity if the update was applied. |
query
insert
update
delete
ReactiveCassandraBatchOperations batchOps()
ReactiveCassandraBatchOperations
. Each ReactiveCassandraBatchOperations
instance can
be executed only once so you might want to obtain new ReactiveCassandraBatchOperations
instances for each
batch.ReactiveCassandraBatchOperations
associated with the given entity class.ReactiveCqlOperations getReactiveCqlOperations()
ReactiveCqlOperations
to allow CQL operations.ReactiveCqlOperations
.ReactiveCqlOperations
CassandraConverter getConverter()
CassandraConverter
.CassandraConverter
.<T> reactor.core.publisher.Flux<T> select(String cql, Class<T> entityClass) throws DataAccessException
SELECT
query and convert the resulting items to a stream of entities.cql
- must not be null.entityClass
- The entity type must not be null.DataAccessException
- if there is any problem issuing the execution.<T> reactor.core.publisher.Mono<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.Mono.empty()
DataAccessException
- if there is any problem issuing the execution.<T> reactor.core.publisher.Flux<T> select(com.datastax.oss.driver.api.core.cql.Statement<?> statement, Class<T> entityClass) throws DataAccessException
SELECT
query and convert the resulting items to a stream of entities.statement
- must not be null.entityClass
- The entity type must not be null.DataAccessException
- if there is any problem issuing the execution.<T> reactor.core.publisher.Mono<Slice<T>> slice(com.datastax.oss.driver.api.core.cql.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.Mono.just(Object)
of an empty Slice
.DataAccessException
- if there is any problem executing the query.<T> reactor.core.publisher.Mono<T> selectOne(com.datastax.oss.driver.api.core.cql.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.Mono.empty()
DataAccessException
- if there is any problem issuing the execution.reactor.core.publisher.Mono<ReactiveResultSet> execute(com.datastax.oss.driver.api.core.cql.Statement<?> statement) throws DataAccessException
Statement
. Any errors that result from executing this command will be converted
into Spring's DAO exception hierarchy.statement
- a Cassandra Statement
, must not be null.ReactiveResultSet
.DataAccessException
- if there is any problem issuing the execution.<T> reactor.core.publisher.Flux<T> select(Query query, Class<T> entityClass) throws DataAccessException
SELECT
query and convert the resulting items to a stream of entities.query
- must not be null.entityClass
- The entity type must not be null.DataAccessException
- if there is any problem issuing the execution.<T> reactor.core.publisher.Mono<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.Mono.just(Object)
of an empty Slice
.DataAccessException
- if there is any problem executing the query.CassandraPageRequest
<T> reactor.core.publisher.Mono<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.Mono.empty()
.DataAccessException
- if there is any problem issuing the execution.reactor.core.publisher.Mono<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.reactor.core.publisher.Mono<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 issuing the execution.reactor.core.publisher.Mono<Long> count(Class<?> entityClass) throws DataAccessException
entityClass
- type
of the entity; must not be null.DataAccessException
- if any problem occurs while executing the query.reactor.core.publisher.Mono<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-defined 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.reactor.core.publisher.Mono<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.reactor.core.publisher.Mono<Boolean> exists(Query query, Class<?> entityClass) throws DataAccessException
entityClass
Query
yields at least one row.query
- user-defined 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> reactor.core.publisher.Mono<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.Mono.empty()
DataAccessException
- if there is any problem issuing the execution.<T> reactor.core.publisher.Mono<T> insert(T entity) throws DataAccessException
entity
- The entity to insert, must not be null.DataAccessException
- if there is any problem issuing the execution.<T> reactor.core.publisher.Mono<EntityWriteResult<T>> insert(T entity, InsertOptions options) throws DataAccessException
WriteOptions
and emit 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 issuing the execution.InsertOptions.empty()
<T> reactor.core.publisher.Mono<T> update(T entity) throws DataAccessException
entity
- The entity to update, must not be null.DataAccessException
- if there is any problem issuing the execution.<T> reactor.core.publisher.Mono<EntityWriteResult<T>> update(T entity, UpdateOptions options) throws DataAccessException
WriteOptions
and emit 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 issuing the execution.UpdateOptions.empty()
<T> reactor.core.publisher.Mono<T> delete(T entity) throws DataAccessException
entity
- must not be null.DataAccessException
- if there is any problem issuing the execution.reactor.core.publisher.Mono<WriteResult> delete(Object entity, QueryOptions options) throws DataAccessException
QueryOptions
and emit 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 issuing the execution.QueryOptions.empty()
default reactor.core.publisher.Mono<WriteResult> delete(Object entity, DeleteOptions options) throws DataAccessException
QueryOptions
and emit 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 issuing the execution.DeleteOptions.empty()
reactor.core.publisher.Mono<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 issuing the execution.reactor.core.publisher.Mono<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 issuing the execution.Copyright © 2011–2021 Pivotal Software, Inc.. All rights reserved.