Class ReactiveCassandraTemplate

All Implemented Interfaces:
Aware, ApplicationContextAware, ApplicationEventPublisherAware, ReactiveCassandraOperations, ReactiveDeleteOperation, ReactiveFluentCassandraOperations, ReactiveInsertOperation, ReactiveSelectOperation, ReactiveUpdateOperation

public class ReactiveCassandraTemplate extends Object implements ReactiveCassandraOperations, ApplicationEventPublisherAware, ApplicationContextAware
Primary implementation of 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,, 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.

Mark Paluch, John Blum, Lukasz Antoniak, Hleb Albau, Sam Lightfoot