Interface RowMapper<T>
- All Known Implementing Classes:
BeanPropertyRowMapper,ColumnMapRowMapper,DataClassRowMapper,SingleColumnRowMapper
- 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 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. DriverExceptions 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.
- Author:
- Matthew T. Adams, Mark Paluch
- See Also:
-
Method Summary
-
Method Details
-
mapRow
@Nullable T mapRow(com.datastax.oss.driver.api.core.cql.Row row, int rowNum) throws com.datastax.oss.driver.api.core.DriverException Implementations must implement this method to map each row of data in theResultSet.- Parameters:
row- theRowto map, must not be null.rowNum- the number of the current row.- Returns:
- the result object 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)
-