public interface RowMapper<T>
CqlTemplate
for mapping rows of a 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.driver.core.Row row,
int rowNum)
Implementations must implement this method to map each row of data in the
ResultSet . |
T mapRow(com.datastax.driver.core.Row row, int rowNum) throws com.datastax.driver.core.exceptions.DriverException
ResultSet
.row
- the Row
to map, must not be null.rowNum
- the number of the current row.com.datastax.driver.core.exceptions.DriverException
- if a DriverException
is encountered getting column values (that is, there's no need
to catch DriverException
)Copyright © 2011–2017 Pivotal Software, Inc.. All rights reserved.