Package org.jdbi.v3.core.mapper
Class SingleColumnMapper<T>
java.lang.Object
org.jdbi.v3.core.mapper.SingleColumnMapper<T>
- All Implemented Interfaces:
RowMapper<T>
Adapts a
ColumnMapper into a RowMapper by mapping a single column.-
Constructor Summary
ConstructorsConstructorDescriptionSingleColumnMapper(ColumnMapper<T> mapper) Constructs a row mapper which maps the first column.SingleColumnMapper(ColumnMapper<T> mapper, int columnNumber) Constructs a row mapper which maps the given column number.SingleColumnMapper(ColumnMapper<T> mapper, String columnLabel) Constructs a row mapper which maps the column with the given label. -
Method Summary
Modifier and TypeMethodDescriptionmap(ResultSet r, StatementContext ctx) Map the current row of the result set.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.jdbi.v3.core.mapper.RowMapper
init, specialize
-
Constructor Details
-
SingleColumnMapper
Constructs a row mapper which maps the first column.- Parameters:
mapper- the column mapper to delegate to for mapping.
-
SingleColumnMapper
Constructs a row mapper which maps the given column number.- Parameters:
mapper- the column mapper to delegate to for mappingcolumnNumber- the column number (1-based) to map
-
SingleColumnMapper
Constructs a row mapper which maps the column with the given label.- Parameters:
mapper- the column mapper to delegate to for mappingcolumnLabel- the label of the column to map
-
-
Method Details
-
map
Description copied from interface:RowMapperMap the current row of the result set. This method should not cause the result set to advance; allow Jdbi to do that, please.- Specified by:
mapin interfaceRowMapper<T>- Parameters:
r- the result set being iteratedctx- the statement context- Returns:
- the value to produce for this row
- Throws:
SQLException- if anything goes wrong go ahead and let this percolate; Jdbi will handle it
-