Package org.jdbi.v3.jpa
Class JpaMapper<C>
java.lang.Object
org.jdbi.v3.jpa.JpaMapper<C>
- Type Parameters:
C
- the type to map
- All Implemented Interfaces:
RowMapper<C>
Row mapper for a JPA-annotated type as a result.
-
Method Summary
Modifier and TypeMethodDescriptionmap
(ResultSet rs, StatementContext ctx) Map the current row of the result set.specialize
(ResultSet rs, StatementContext ctx) Returns a specialized row mapper, optimized for the given result set.
-
Method Details
-
specialize
Description copied from interface:RowMapper
Returns 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:
specialize
in interfaceRowMapper<C>
- Parameters:
rs
- the result set to specialize overctx
- the statement context to specialize over- Returns:
- a row mapper equivalent to this one, possibly specialized.
- Throws:
SQLException
- if anything goes wrong go ahead and let this percolate; Jdbi will handle it- See Also:
-
map
Description copied from interface:RowMapper
Map 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:
map
in interfaceRowMapper<C>
- Parameters:
rs
- 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
-