@FunctionalInterface public interface RowMapper<T>
CqlTemplate
for mapping rows of a com.datastax.driver.core.ResultSet
on a
per-row basis. Implementations of this interface perform the actual work of mapping each row to a result object, but
don't need to worry about exception handling. DriverException
s will be caught and handled by the calling
CqlTemplate
.
Typically used either for CqlTemplate
's query methods or for out parameters of stored procedures.
RowMapper
objects are typically stateless and thus reusable; they are an ideal choice for implementing
row-mapping logic in a single place.
RowCallbackHandler
,
ResultSetExtractor
Modifier and Type | Method and Description |
---|---|
T |
mapRow(com.datastax.oss.driver.api.core.cql.Row row,
int rowNum)
Implementations must implement this method to map each row of data in the
com.datastax.driver.core.ResultSet . |
@Nullable T mapRow(com.datastax.oss.driver.api.core.cql.Row row, int rowNum) throws com.datastax.oss.driver.api.core.DriverException
com.datastax.driver.core.ResultSet
.row
- the Row
to map, must not be null.rowNum
- the number of 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–2020 Pivotal Software, Inc.. All rights reserved.