public class SingleColumnMapper<T> extends Object implements ResultSetMapper<T>
ResultColumnMapper into a ResultSetMapper by mapping a single column.| Constructor and Description |
|---|
SingleColumnMapper(ResultColumnMapper<T> columnMapper)
Constructs a result set mapper which maps the first column.
|
SingleColumnMapper(ResultColumnMapper<T> columnMapper,
int columnNumber)
Constructs a result set mapper which maps the given column number.
|
SingleColumnMapper(ResultColumnMapper<T> columnMapper,
String columnLabel)
Constructs a result set mapper which maps the column with the given label.
|
| Modifier and Type | Method and Description |
|---|---|
T |
map(int index,
ResultSet r,
StatementContext ctx)
Map the row the result set is at when passed in.
|
public SingleColumnMapper(ResultColumnMapper<T> columnMapper)
columnMapper - the column mapper to delegate to for mapping.public SingleColumnMapper(ResultColumnMapper<T> columnMapper, int columnNumber)
columnMapper - the column mapper to delegate to for mappingcolumnNumber - the column number (1-based) to mappublic SingleColumnMapper(ResultColumnMapper<T> columnMapper, String columnLabel)
columnMapper - the column mapper to delegate to for mappingcolumnLabel - the column label to mappublic T map(int index, ResultSet r, StatementContext ctx) throws SQLException
ResultSetMappermap in interface ResultSetMapper<T>index - which row of the result set we are at, starts at 0r - the result set being iteratedSQLException - if anything goes wrong go ahead and let this percolate, jDBI will handle itCopyright © 2018. All rights reserved.