Class ReactiveCassandraTemplate
- All Implemented Interfaces:
Aware,ApplicationContextAware,ApplicationEventPublisherAware,ReactiveCassandraOperations,ReactiveDeleteOperation,ReactiveFluentCassandraOperations,ReactiveInsertOperation,ReactiveSelectOperation,ReactiveUpdateOperation
ReactiveCassandraOperations. It simplifies the use of Reactive Cassandra usage and
helps to avoid common errors. It executes core Cassandra workflow. This class executes CQL queries or updates,
initiating iteration over ReactiveResultSet and catching Cassandra exceptions and translating them to the
generic, more informative exception hierarchy defined in the org.springframework.dao package.
Can be used within a service implementation via direct instantiation with a ReactiveSessionFactory reference,
or get prepared in an application context and given to services as bean reference.
This class supports the use of prepared statements when enabling setUsePreparedStatements(boolean). All
statements created by methods of this class (such as select(Query, Class) or
update(Query, org.springframework.data.cassandra.core.query.Update, Class) will be executed as prepared
statements. Also, statements accepted by methods (such as select(String, Class) or
and others) will be prepared prior to execution. Note that Statement
objects passed to methods must be SimpleStatement so that these can be prepared.
Note: The ReactiveSessionFactory should always be configured as a bean in the application context, in the
first case given to the service directly, in the second case to the prepared template.
- Since:
- 2.0
- Author:
- Mark Paluch, John Blum, Lukasz Antoniak, Hleb Albau, Sam Lightfoot
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classUtility class to prepare aSimpleStatementand bind values associated with the statement to aBoundStatement.static interfaceGeneral callback interface used to create and bind prepared CQL statements.Nested classes/interfaces inherited from interface org.springframework.data.cassandra.core.ReactiveDeleteOperation
ReactiveDeleteOperation.DeleteWithQuery, ReactiveDeleteOperation.DeleteWithTable, ReactiveDeleteOperation.ReactiveDelete, ReactiveDeleteOperation.TerminatingDeleteNested classes/interfaces inherited from interface org.springframework.data.cassandra.core.ReactiveInsertOperation
ReactiveInsertOperation.InsertWithOptions<T>, ReactiveInsertOperation.InsertWithTable<T>, ReactiveInsertOperation.ReactiveInsert<T>, ReactiveInsertOperation.TerminatingInsert<T>Nested classes/interfaces inherited from interface org.springframework.data.cassandra.core.ReactiveSelectOperation
ReactiveSelectOperation.ReactiveSelect<T>, ReactiveSelectOperation.SelectWithProjection<T>, ReactiveSelectOperation.SelectWithQuery<T>, ReactiveSelectOperation.SelectWithTable<T>, ReactiveSelectOperation.TerminatingSelect<T>Nested classes/interfaces inherited from interface org.springframework.data.cassandra.core.ReactiveUpdateOperation
ReactiveUpdateOperation.ReactiveUpdate, ReactiveUpdateOperation.TerminatingUpdate, ReactiveUpdateOperation.UpdateWithQuery, ReactiveUpdateOperation.UpdateWithTable -
Constructor Summary
ConstructorsConstructorDescriptionReactiveCassandraTemplate(ReactiveCqlOperations reactiveCqlOperations, CassandraConverter converter) Create an instance ofReactiveCassandraTemplateinitialized with the givenReactiveCqlOperationsandCassandraConverter.ReactiveCassandraTemplate(ReactiveSession session) Creates an instance ofReactiveCassandraTemplateinitialized with the givenReactiveSessionand a defaultMappingCassandraConverter.ReactiveCassandraTemplate(ReactiveSessionFactory sessionFactory, CassandraConverter converter) Create an instance ofReactiveCassandraTemplateinitialized with the givenReactiveSessionFactoryandCassandraConverter.ReactiveCassandraTemplate(ReactiveSession session, CassandraConverter converter) Create an instance ofCassandraTemplateinitialized with the givenReactiveSessionandCassandraConverter. -
Method Summary
Modifier and TypeMethodDescriptionbatchOps(com.datastax.oss.driver.api.core.cql.BatchType batchType) Returns a newReactiveCassandraBatchOperations.reactor.core.publisher.Mono<Long>Returns the number of rows for the given entity class.reactor.core.publisher.Mono<Long>Returns the number of rows for the given entity class applyingQuery.createPreparedStatementHandler(com.datastax.oss.driver.api.core.cql.Statement<?> statement) Create a new statement-basedReactiveCassandraTemplate.ReactivePreparedStatementHandlerusing the statement passed in.Begin creating aDELETEoperation for the givendomainType.reactor.core.publisher.Mono<WriteResult>delete(Object entity, QueryOptions options) Delete the given entity applyingQueryOptionsand emit the entity if the delete statement was applied.reactor.core.publisher.Mono<Boolean>Remove entities (rows)/columns from the table byQuery.<T> reactor.core.publisher.Mono<T>delete(T entity) Delete the given entity and emit the entity if the delete statement 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 given CassandraStatement.reactor.core.publisher.Mono<Boolean>Determine whether a row ofentityClasswith the givenidexists.reactor.core.publisher.Mono<Boolean>Determine whether the result forentityClassQueryyields at least one row.Returns the underlyingCassandraConverter.protected org.springframework.data.cassandra.core.EntityOperationsReturns theEntityOperationsused to perform data access operations on an entity inside a Cassandra data source.protected SpelAwareProxyProjectionFactoryDeprecated.Expose the underlyingReactiveCqlOperationsto allow CQL operations.protected StatementFactoryReturns theStatementFactoryused by this template to construct and run Cassandra CQL statements.Begin creating anINSERToperation for givendomainType.<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 applyingWriteOptionsand emit the entity if the insert was applied.booleanReturns whether this instance is configured to useprepared statements.protected <T> reactor.core.publisher.Mono<T>maybeCallBeforeConvert(T object, com.datastax.oss.driver.api.core.CqlIdentifier tableName) protected <T> reactor.core.publisher.Mono<T>maybeCallBeforeSave(T object, com.datastax.oss.driver.api.core.CqlIdentifier tableName, com.datastax.oss.driver.api.core.cql.Statement<?> statement) protected <E extends CassandraMappingEvent<T>,T>
voidmaybeEmitEvent(Supplier<E> event) Begin creating aSELECToperation for the givendomainType.<T> reactor.core.publisher.Flux<T>Execute aSELECTquery and convert the resulting items to a stream of entities.<T> reactor.core.publisher.Flux<T>Execute aSELECTquery and convert the resulting items to a stream of entities.<T> reactor.core.publisher.Flux<T>Execute aSELECTquery and convert the resulting items to a stream of entities.<T> reactor.core.publisher.Mono<T>Execute aSELECTquery and convert the resulting item to an entity.<T> reactor.core.publisher.Mono<T>Execute aSELECTquery and convert the resulting item to an entity.<T> reactor.core.publisher.Mono<T>Execute aSELECTquery and convert the resulting item to an entity.<T> reactor.core.publisher.Mono<T>selectOneById(Object id, Class<T> entityClass) Execute the Select byidfor the givenentityClass.voidsetApplicationContext(ApplicationContext applicationContext) voidsetApplicationEventPublisher(ApplicationEventPublisher applicationEventPublisher) voidsetEntityCallbacks(ReactiveEntityCallbacks entityCallbacks) ConfigureEntityCallbacksto pre-/post-process entities during persistence operations.voidsetEntityLifecycleEventsEnabled(boolean enabled) Configure whether lifecycle events such asAfterLoadEvent,BeforeSaveEvent, etc. should be published or whether emission should be suppressed.voidsetUsePreparedStatements(boolean usePreparedStatements) Enable/disableprepared statementsusage.<T> reactor.core.publisher.Mono<Slice<T>>Execute aSELECTquery with paging and convert the result set to aSliceof entities.<T> reactor.core.publisher.Mono<Slice<T>>Execute aSELECTquery with paging and convert the result set to aSliceof entities.reactor.core.publisher.Mono<Void>Execute aTRUNCATEquery to remove all entities of a given class.Begin creating anUPDATEoperation for the givendomainType.reactor.core.publisher.Mono<Boolean>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 applyingWriteOptionsand emit the entity if the update was applied.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.data.cassandra.core.ReactiveCassandraOperations
batchOps, delete
-
Constructor Details
-
ReactiveCassandraTemplate
Creates an instance ofReactiveCassandraTemplateinitialized with the givenReactiveSessionand a defaultMappingCassandraConverter.- Parameters:
session-ReactiveSessionused to interact with Cassandra; must not be null.- See Also:
-
ReactiveCassandraTemplate
Create an instance ofCassandraTemplateinitialized with the givenReactiveSessionandCassandraConverter.- Parameters:
session-ReactiveSessionused to interact with Cassandra; must not be null.converter-CassandraConverterused to convert between Java and Cassandra types; must not be null.- See Also:
-
ReactiveCassandraTemplate
public ReactiveCassandraTemplate(ReactiveSessionFactory sessionFactory, CassandraConverter converter) Create an instance ofReactiveCassandraTemplateinitialized with the givenReactiveSessionFactoryandCassandraConverter.- Parameters:
sessionFactory-ReactiveSessionFactoryused to interact with Cassandra; must not be null.converter-CassandraConverterused to convert between Java and Cassandra types; must not be null.- See Also:
-
ReactiveCassandraTemplate
public ReactiveCassandraTemplate(ReactiveCqlOperations reactiveCqlOperations, CassandraConverter converter) Create an instance ofReactiveCassandraTemplateinitialized with the givenReactiveCqlOperationsandCassandraConverter.- Parameters:
reactiveCqlOperations-ReactiveCqlOperationsused to interact with Cassandra; must not be null.converter-CassandraConverterused to convert between Java and Cassandra types; must not be null.- See Also:
-
-
Method Details
-
batchOps
public ReactiveCassandraBatchOperations batchOps(com.datastax.oss.driver.api.core.cql.BatchType batchType) Description copied from interface:ReactiveCassandraOperationsReturns a newReactiveCassandraBatchOperations. EachReactiveCassandraBatchOperationsinstance can be executed only once, so you need to obtain newReactiveCassandraBatchOperationsinstances for each batch.- Specified by:
batchOpsin interfaceReactiveCassandraOperations- Parameters:
batchType- must not be null.- Returns:
- a new
ReactiveCassandraBatchOperationsassociated with the given entity class.
-
setApplicationEventPublisher
- Specified by:
setApplicationEventPublisherin interfaceApplicationEventPublisherAware
-
setApplicationContext
- Specified by:
setApplicationContextin interfaceApplicationContextAware- Throws:
BeansException
-
setEntityCallbacks
ConfigureEntityCallbacksto pre-/post-process entities during persistence operations.- Parameters:
entityCallbacks-
-
setEntityLifecycleEventsEnabled
public void setEntityLifecycleEventsEnabled(boolean enabled) Configure whether lifecycle events such asAfterLoadEvent,BeforeSaveEvent, etc. should be published or whether emission should be suppressed. Enabled by default.- Parameters:
enabled-trueto enable entity lifecycle events;falseto disable entity lifecycle events.- Since:
- 4.0
- See Also:
-
getReactiveCqlOperations
Description copied from interface:ReactiveCassandraOperationsExpose the underlyingReactiveCqlOperationsto allow CQL operations.- Specified by:
getReactiveCqlOperationsin interfaceReactiveCassandraOperations- Returns:
- the underlying
ReactiveCqlOperations. - See Also:
-
getConverter
Description copied from interface:ReactiveCassandraOperationsReturns the underlyingCassandraConverter.- Specified by:
getConverterin interfaceReactiveCassandraOperations- Returns:
- the underlying
CassandraConverter.
-
isUsePreparedStatements
public boolean isUsePreparedStatements()Returns whether this instance is configured to useprepared statements. If enabled (default), then all persistence methods (such asselect(java.lang.String, java.lang.Class<T>),update(org.springframework.data.cassandra.core.query.Query, org.springframework.data.cassandra.core.query.Update, java.lang.Class<?>), and others) will make use of prepared statements. Note that methods accepting aStatementmust be called withSimpleStatementinstances to participate in statement preparation.- Returns:
- true if prepared statements usage is enabled; false otherwise.
- Since:
- 3.2
-
setUsePreparedStatements
public void setUsePreparedStatements(boolean usePreparedStatements) Enable/disableprepared statementsusage. If enabled (default), then all persistence methods (such asselect(java.lang.String, java.lang.Class<T>),update(org.springframework.data.cassandra.core.query.Query, org.springframework.data.cassandra.core.query.Update, java.lang.Class<?>), and others) will make use of prepared statements. Note that methods accepting aStatementmust be called withSimpleStatementinstances to participate in statement preparation.- Parameters:
usePreparedStatements- whether to use prepared statements.- Since:
- 3.2
-
getEntityOperations
protected org.springframework.data.cassandra.core.EntityOperations getEntityOperations()Returns theEntityOperationsused to perform data access operations on an entity inside a Cassandra data source.- Returns:
- the configured
EntityOperationsfor this template. - See Also:
-
EntityOperations
-
getProjectionFactory
Deprecated.since 3.4, useCassandraConverter.getProjectionFactory()instead.Returns a reference to the configuredProjectionFactoryused by this template to process CQL query projections.- Returns:
- a reference to the configured
ProjectionFactoryused by this template to process CQL query projections. - Since:
- 2.1
- See Also:
-
getStatementFactory
Returns theStatementFactoryused by this template to construct and run Cassandra CQL statements.- Returns:
- the
StatementFactoryused by this template to construct and run Cassandra CQL statements. - Since:
- 2.1
- See Also:
-
select
Description copied from interface:ReactiveCassandraOperationsExecute aSELECTquery and convert the resulting items to a stream of entities.- Specified by:
selectin interfaceReactiveCassandraOperations- Parameters:
cql- must not be null.entityClass- The entity type must not be null.- Returns:
- the converted results
-
selectOne
Description copied from interface:ReactiveCassandraOperationsExecute aSELECTquery and convert the resulting item to an entity.- Specified by:
selectOnein interfaceReactiveCassandraOperations- Parameters:
cql- must not be null.entityClass- The entity type must not be null.- Returns:
- the result object returned by the action or
Mono.empty()
-
execute
public reactor.core.publisher.Mono<ReactiveResultSet> execute(com.datastax.oss.driver.api.core.cql.Statement<?> statement) throws DataAccessException Description copied from interface:ReactiveCassandraOperationsExecute the given CassandraStatement. Any errors that result from executing this command will be converted into Spring's DAO exception hierarchy.- Specified by:
executein interfaceReactiveCassandraOperations- Parameters:
statement- a CassandraStatement, must not be null.- Returns:
- the
ReactiveResultSet. - Throws:
DataAccessException- if there is any problem issuing the execution.
-
select
public <T> reactor.core.publisher.Flux<T> select(com.datastax.oss.driver.api.core.cql.Statement<?> statement, Class<T> entityClass) Description copied from interface:ReactiveCassandraOperationsExecute aSELECTquery and convert the resulting items to a stream of entities.- Specified by:
selectin interfaceReactiveCassandraOperations- Parameters:
statement- must not be null.entityClass- The entity type must not be null.- Returns:
- the result objects returned by the action.
-
selectOne
public <T> reactor.core.publisher.Mono<T> selectOne(com.datastax.oss.driver.api.core.cql.Statement<?> statement, Class<T> entityClass) Description copied from interface:ReactiveCassandraOperationsExecute aSELECTquery and convert the resulting item to an entity.- Specified by:
selectOnein interfaceReactiveCassandraOperations- Parameters:
statement- must not be null.entityClass- The entity type must not be null.- Returns:
- the result object returned by the action or
Mono.empty()
-
slice
public <T> reactor.core.publisher.Mono<Slice<T>> slice(com.datastax.oss.driver.api.core.cql.Statement<?> statement, Class<T> entityClass) Description copied from interface:ReactiveCassandraOperationsExecute aSELECTquery with paging and convert the result set to aSliceof entities. A sliced query translates the effectivefetch sizeto the page size.- Specified by:
slicein interfaceReactiveCassandraOperations- Parameters:
statement- the CQL statement, must not be null.entityClass- The entity type must not be null.- Returns:
- the result object returned by the action or
Mono.just(Object)of an emptySlice.
-
select
public <T> reactor.core.publisher.Flux<T> select(Query query, Class<T> entityClass) throws DataAccessException Description copied from interface:ReactiveCassandraOperationsExecute aSELECTquery and convert the resulting items to a stream of entities.- Specified by:
selectin interfaceReactiveCassandraOperations- Parameters:
query- must not be null.entityClass- The entity type must not be null.- Returns:
- the result objects returned by the action.
- Throws:
DataAccessException- if there is any problem issuing the execution.
-
selectOne
public <T> reactor.core.publisher.Mono<T> selectOne(Query query, Class<T> entityClass) throws DataAccessException Description copied from interface:ReactiveCassandraOperationsExecute aSELECTquery and convert the resulting item to an entity.- Specified by:
selectOnein interfaceReactiveCassandraOperations- Parameters:
query- must not be null.entityClass- The entity type must not be null.- Returns:
- the result object returned by the action or
Mono.empty(). - Throws:
DataAccessException- if there is any problem issuing the execution.
-
slice
public <T> reactor.core.publisher.Mono<Slice<T>> slice(Query query, Class<T> entityClass) throws DataAccessException Description copied from interface:ReactiveCassandraOperationsExecute aSELECTquery with paging and convert the result set to aSliceof entities.- Specified by:
slicein interfaceReactiveCassandraOperations- 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 result object returned by the action or
Mono.just(Object)of an emptySlice. - Throws:
DataAccessException- if there is any problem executing the query.- See Also:
-
update
public reactor.core.publisher.Mono<Boolean> update(Query query, Update update, Class<?> entityClass) throws DataAccessException Description copied from interface:ReactiveCassandraOperationsUpdate the queried entities and return true if the update was applied.- Specified by:
updatein interfaceReactiveCassandraOperations- 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
public reactor.core.publisher.Mono<Boolean> delete(Query query, Class<?> entityClass) throws DataAccessException Description copied from interface:ReactiveCassandraOperationsRemove entities (rows)/columns from the table byQuery.- Specified by:
deletein interfaceReactiveCassandraOperations- 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 issuing the execution.
-
count
Description copied from interface:ReactiveCassandraOperationsReturns the number of rows for the given entity class.- Specified by:
countin interfaceReactiveCassandraOperations- Parameters:
entityClass-typeof the entity; must not be null.- Returns:
- the number of existing entities.
-
count
public reactor.core.publisher.Mono<Long> count(Query query, Class<?> entityClass) throws DataAccessException Description copied from interface:ReactiveCassandraOperationsReturns the number of rows for the given entity class applyingQuery. This overridden method allows users to further refine the selection criteria using aQuerypredicate to determine how many entities of the giventypematch the criteria.- Specified by:
countin interfaceReactiveCassandraOperations- Parameters:
query- user-defined countQueryto execute; must not be null.entityClass-typeof the entity; must not be null.- Returns:
- the number of existing entities.
- Throws:
DataAccessException- if any problem occurs while executing the query.
-
exists
Description copied from interface:ReactiveCassandraOperationsDetermine whether a row ofentityClasswith the givenidexists.- Specified by:
existsin interfaceReactiveCassandraOperations- Parameters:
id- Id value. For single primary keys it's the plain value. For composite primary keys either, it's an instance of eitherPrimaryKeyClassorMapId. Must not be null.entityClass-typeof the entity; must not be null.- Returns:
- true if the object exists.
-
exists
public reactor.core.publisher.Mono<Boolean> exists(Query query, Class<?> entityClass) throws DataAccessException Description copied from interface:ReactiveCassandraOperationsDetermine whether the result forentityClassQueryyields at least one row.- Specified by:
existsin interfaceReactiveCassandraOperations- Parameters:
query- user-defined existsQueryto execute; must not be null.entityClass-typeof the entity; must not be null.- Returns:
- true if the object exists.
- Throws:
DataAccessException- if any problem occurs while executing the query.
-
selectOneById
Description copied from interface:ReactiveCassandraOperationsExecute the Select byidfor the givenentityClass.- Specified by:
selectOneByIdin interfaceReactiveCassandraOperations- Parameters:
id- the Id value. For single primary keys it's the plain value. For composite primary keys either thePrimaryKeyClassorMapId. Must not be null.entityClass- The entity type must not be null.- Returns:
- the result object returned by the action or
Mono.empty()
-
insert
public <T> reactor.core.publisher.Mono<T> insert(T entity) Description copied from interface:ReactiveCassandraOperationsInsert the given entity and emit the entity if the insert was applied.- Specified by:
insertin interfaceReactiveCassandraOperations- Parameters:
entity- The entity to insert, must not be null.- Returns:
- the inserted entity.
-
insert
public <T> reactor.core.publisher.Mono<EntityWriteResult<T>> insert(T entity, InsertOptions options) Description copied from interface:ReactiveCassandraOperationsInsert the given entity applyingWriteOptionsand emit the entity if the insert was applied.- Specified by:
insertin interfaceReactiveCassandraOperations- Parameters:
entity- The entity to insert, must not be null.options- must not be null.- Returns:
- the
EntityWriteResultfor this operation. - See Also:
-
update
public <T> reactor.core.publisher.Mono<T> update(T entity) Description copied from interface:ReactiveCassandraOperationsUpdate the given entity and emit the entity if the update was applied.- Specified by:
updatein interfaceReactiveCassandraOperations- Parameters:
entity- The entity to update, must not be null.- Returns:
- the updated entity.
-
update
public <T> reactor.core.publisher.Mono<EntityWriteResult<T>> update(T entity, UpdateOptions options) Description copied from interface:ReactiveCassandraOperationsUpdate the given entity applyingWriteOptionsand emit the entity if the update was applied.- Specified by:
updatein interfaceReactiveCassandraOperations- Parameters:
entity- The entity to update, must not be null.options- must not be null.- Returns:
- the
EntityWriteResultfor this operation. - See Also:
-
delete
public <T> reactor.core.publisher.Mono<T> delete(T entity) Description copied from interface:ReactiveCassandraOperationsDelete the given entity and emit the entity if the delete statement was applied.- Specified by:
deletein interfaceReactiveCassandraOperations- Parameters:
entity- must not be null.- Returns:
- the deleted entity.
-
delete
Description copied from interface:ReactiveCassandraOperationsDelete the given entity applyingQueryOptionsand emit the entity if the delete statement was applied.- Specified by:
deletein interfaceReactiveCassandraOperations- Parameters:
entity- must not be null.options- must not be null.- Returns:
- the
WriteResultfor this operation. - See Also:
-
deleteById
Description copied from interface:ReactiveCassandraOperationsRemove the given object from the table by id.- Specified by:
deleteByIdin interfaceReactiveCassandraOperations- Parameters:
id- the Id value. For single primary keys it's the plain value. For composite primary keys either thePrimaryKeyClassorMapId. Must not be null.entityClass- The entity type must not be null.- Returns:
- true if the deletion was applied.
-
truncate
Description copied from interface:ReactiveCassandraOperationsExecute aTRUNCATEquery to remove all entities of a given class.- Specified by:
truncatein interfaceReactiveCassandraOperations- Parameters:
entityClass- The entity type must not be null.
-
delete
Description copied from interface:ReactiveDeleteOperationBegin creating aDELETEoperation for the givendomainType.- Specified by:
deletein interfaceReactiveDeleteOperation- Parameters:
domainType-typeof domain object to delete; must not be null.- Returns:
- new instance of
ReactiveDeleteOperation.ReactiveDelete. - See Also:
-
insert
Description copied from interface:ReactiveInsertOperationBegin creating anINSERToperation for givendomainType.- Specified by:
insertin interfaceReactiveInsertOperation- Type Parameters:
T-typeof the application domain object.- Parameters:
domainType-typeof the domain object to insert; must not be null.- Returns:
- new instance of
ReactiveInsertOperation.ReactiveInsert. - See Also:
-
query
Description copied from interface:ReactiveSelectOperationBegin creating aSELECToperation for the givendomainType.- Specified by:
queryin interfaceReactiveSelectOperation- Type Parameters:
T-typeof the application domain object.- Parameters:
domainType-typeof the domain object to query; must not be null.- Returns:
- new instance of
ReactiveSelectOperation.ReactiveSelect. - See Also:
-
update
Description copied from interface:ReactiveUpdateOperationBegin creating anUPDATEoperation for the givendomainType.- Specified by:
updatein interfaceReactiveUpdateOperation- Parameters:
domainType-typeof domain object to update; must not be null.- Returns:
- new instance of
ReactiveUpdateOperation.ReactiveUpdate. - See Also:
-
createPreparedStatementHandler
protected ReactiveCassandraTemplate.ReactivePreparedStatementHandler createPreparedStatementHandler(com.datastax.oss.driver.api.core.cql.Statement<?> statement) Create a new statement-basedReactiveCassandraTemplate.ReactivePreparedStatementHandlerusing the statement passed in.This method allows for the creation to be overridden by subclasses.
- Parameters:
statement- the statement to be prepared.- Returns:
- the new
ReactiveCassandraTemplate.PreparedStatementHandlerto use. - Since:
- 3.3.3
-
maybeEmitEvent
-
maybeCallBeforeConvert
protected <T> reactor.core.publisher.Mono<T> maybeCallBeforeConvert(T object, com.datastax.oss.driver.api.core.CqlIdentifier tableName) -
maybeCallBeforeSave
protected <T> reactor.core.publisher.Mono<T> maybeCallBeforeSave(T object, com.datastax.oss.driver.api.core.CqlIdentifier tableName, com.datastax.oss.driver.api.core.cql.Statement<?> statement)
-
CassandraConverter.getProjectionFactory()instead.