Interface RowCallbackHandler
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
An interface used by
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. DriverExceptions
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.
- Author:
- Mark Paluch
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoidprocessRow(com.datastax.oss.driver.api.core.cql.Row row) Implementations must implement this method to process each row of data in theResultSet.
-
Method Details
-
processRow
void processRow(com.datastax.oss.driver.api.core.cql.Row row) throws com.datastax.oss.driver.api.core.DriverException Implementations must implement this method to process each row of data in theResultSet. 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.
- Parameters:
row- theRowto process (pre-initialized for the current row).- Throws:
com.datastax.oss.driver.api.core.DriverException- if aDriverExceptionis encountered getting column values (that is, there's no need to catchDriverException).
-