Map<String,Object>. Map keys are column names, while map values are the values in those columns. Map keys are converted to lowercase by default.
|Constructor and Description|
Constructs a new MapMapper, with map keys converted to lowercase.
Constructs a new MapMapper
|Modifier and Type||Method and Description|
Map the row the result set is at when passed in.
Returns a specialized row mapper, optimized for the given result set.
public MapMapper(boolean foldCase)
foldCase- if true, column names are converted to lowercase in the mapped
public Map<String,Object> map(ResultSet rs, StatementContext ctx) throws SQLException
public RowMapper<Map<String,Object>> specialize(ResultSet rs, StatementContext ctx) throws SQLException
Before 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.
rs- the result set to specialize over
ctx- the statement context to specialize over
SQLException- if anything goes wrong go ahead and let this percolate; Jdbi will handle it
for an example of specialization.
Copyright © 2018. All rights reserved.