T - @FunctionalInterface public interface ReactiveStatementCallback<T>
Statement. Allows to execute any number of
operations on a single Statement, for example a single ReactiveSession.execute(Statement).
Used internally by ReactiveCqlTemplate, but also useful for application code.
| Modifier and Type | Method and Description |
|---|---|
org.reactivestreams.Publisher<T> |
doInStatement(ReactiveSession session,
com.datastax.oss.driver.api.core.cql.Statement<?> stmt)
Gets called by
ReactiveCqlTemplate.execute(String) with an active Cassandra session. |
org.reactivestreams.Publisher<T> doInStatement(ReactiveSession session, com.datastax.oss.driver.api.core.cql.Statement<?> stmt) throws com.datastax.oss.driver.api.core.DriverException, DataAccessException
ReactiveCqlTemplate.execute(String) with an active Cassandra session. Does not need to care
about closing the the session: this will all be handled by Spring's ReactiveCqlTemplate.
Allows for returning a result object created within the callback, i.e. a domain object or a collection of domain
objects. Note that there's special support for single step actions: see
ReactiveCqlTemplate.queryForObject(String, Class, Object...) etc. A thrown RuntimeException is treated as
application exception, it gets propagated to the caller of the template.
session - active Cassandra session.stmt - CQL Statement.com.datastax.oss.driver.api.core.DriverException - if thrown by a session method, to be auto-converted to a DataAccessExceptionDataAccessException - in case of custom exceptionsReactiveCqlTemplate.query(String, ReactiveResultSetExtractor),
ReactiveCqlTemplate.query(Statement, ReactiveResultSetExtractor)Copyright © 2011–2021 Pivotal Software, Inc.. All rights reserved.