T - @FunctionalInterface @Beta public interface RowViewMapper<T> extends RowMapper<T>
| Modifier and Type | Method and Description |
|---|---|
default T |
map(ResultSet rs,
StatementContext ctx)
Map the current row of the result set.
|
T |
map(RowView rowView)
Produce a single result item from the current row of a
RowView. |
default RowMapper<T> |
specialize(ResultSet rs,
StatementContext ctx)
Returns a specialized row mapper, optimized for the given result set.
|
default T map(ResultSet rs, StatementContext ctx) throws SQLException
RowMappermap in interface RowMapper<T>rs - the result set being iteratedctx - the statement contextSQLException - if anything goes wrong go ahead and let this percolate; Jdbi will handle itT map(RowView rowView) throws SQLException
RowView.rowView - the view into the current row of the ResultSetSQLException - something went wrongdefault RowMapper<T> specialize(ResultSet rs, StatementContext ctx) throws SQLException
RowMapperBefore mapping the result set from a SQL statement; Jdbi will first call this method to obtain a specialized instance. The returned mapper will then be used to map the result set rows, and discarded.
Implementing this method is optional; the default implementation returns this. Implementors might choose
to override this method to improve performance, e.g. by matching up column names to properties once for the
entire result set, rather than repeating the process for every row.
specialize in interface RowMapper<T>rs - the result set to specialize overctx - the statement context to specialize overSQLException - if anything goes wrong go ahead and let this percolate; Jdbi will handle itfor an example of specialization.Copyright © 2019. All rights reserved.