@FunctionalInterface public interface RowCallbackHandler
CqlTemplate
for processing rows of a
ResultSet
on a per-row basis. Implementations of this interface perform
the actual work of processing each row but don't need to worry about exception handling. DriverException
s
will be caught and handled by the calling CqlTemplate
.
In contrast to a ResultSetExtractor
, a RowCallbackHandler
object is typically stateful: It keeps the
result state within the object, to be available for later inspection.
Consider using a RowMapper
instead if you need to map exactly one result object per row, assembling them into
a List.
CqlTemplate
,
RowMapper
,
ResultSetExtractor
Modifier and Type | Method and Description |
---|---|
void |
processRow(com.datastax.oss.driver.api.core.cql.Row row)
Implementations must implement this method to process each row of data in the
ResultSet . |
void processRow(com.datastax.oss.driver.api.core.cql.Row row) throws com.datastax.oss.driver.api.core.DriverException
ResultSet
. This method is only supposed to extract values of the
current row.
Exactly what the implementation chooses to do is up to it: A trivial implementation might simply count rows, while another implementation might build an XML document.
row
- the Row
to process (pre-initialized for the current row).com.datastax.oss.driver.api.core.DriverException
- if a DriverException
is encountered getting column values (that is, there's no need
to catch DriverException
).Copyright © 2011–2021 Pivotal Software, Inc.. All rights reserved.