RowMapperimplementation to easily compose existing RowMappers. As the name implies, it is most commonly used for retrieving multiple tables' Java representations from a joined row.
Method SummaryModifier and TypeMethodDescription
static JoinRowMapperCreate a JoinRowMapper that maps each of the given types and returns a
JoinRowwith the resulting values.Map the current row of the result set.Returns a specialized row mapper, optimized for the given result set.
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
mapDescription 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.
specializeDescription copied from interface:
RowMapperReturns a specialized row mapper, optimized for the given result set.
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.
- Specified by:
r- the result set to specialize over
ctx- the statement context to specialize over
- a row mapper equivalent to this one, possibly specialized.
SQLException- if anything goes wrong go ahead and let this percolate; Jdbi will handle it
- See Also:
forTypesCreate a JoinRowMapper that maps each of the given types and returns a
JoinRowwith the resulting values.
classes- the types to extract
- a JoinRowMapper that extracts the given types