Module spring.data.cassandra
Class ReactiveRowMapperResultSetExtractor<T>
java.lang.Object
org.springframework.data.cassandra.core.cql.ReactiveRowMapperResultSetExtractor<T>
- All Implemented Interfaces:
ReactiveResultSetExtractor<T>
public class ReactiveRowMapperResultSetExtractor<T>
extends Object
implements ReactiveResultSetExtractor<T>
Adapter implementation of the
ReactiveResultSetExtractor
interface that delegates to a RowMapper
which is supposed to create an object for each row. Each object is emitted through the Publisher
of this
ReactiveResultSetExtractor
.
Useful for the typical case of one object per row in the database table. The number of entries in the results will match the number of rows.
Note that a RowMapper
object is typically stateless and thus reusable.
- Since:
- 2.0
- Author:
- Mark Paluch
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionReactiveRowMapperResultSetExtractor
(RowMapper<T> rowMapper) Create a newReactiveRowMapperResultSetExtractor
. -
Method Summary
Modifier and TypeMethodDescriptionorg.reactivestreams.Publisher<T>
extractData
(ReactiveResultSet resultSet) Implementations must implement this method to process the entireReactiveResultSet
.
-
Constructor Details
-
ReactiveRowMapperResultSetExtractor
Create a newReactiveRowMapperResultSetExtractor
.- Parameters:
rowMapper
- theRowMapper
which creates an object for each row, must not be null.
-
-
Method Details
-
extractData
public org.reactivestreams.Publisher<T> extractData(ReactiveResultSet resultSet) throws com.datastax.oss.driver.api.core.DriverException, DataAccessException Description copied from interface:ReactiveResultSetExtractor
Implementations must implement this method to process the entireReactiveResultSet
.- Specified by:
extractData
in interfaceReactiveResultSetExtractor<T>
- Parameters:
resultSet
-ReactiveResultSet
to extract data from, must not be null.- Returns:
- an arbitrary result object
Publisher
. - Throws:
com.datastax.oss.driver.api.core.DriverException
- if aDriverException
is encountered getting column values or navigating (that is, there's no need to catchDriverException
).DataAccessException
- in case of custom exceptions.
-