Package org.jdbi.v3.core.result
Interface RowReducer<C,R>
-
- Type Parameters:
C- mutable result container typeR- result element type
- All Known Subinterfaces:
LinkedHashMapRowReducer<K,V>
public interface RowReducer<C,R>Reduces row data from aResultSetinto a stream of result elements. Useful for collapsing one-to-many joins.- See Also:
ResultBearing.reduceRows(RowReducer)
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaccumulate(C container, RowView rowView)Accumulate data from the current row into the result container.Ccontainer()Returns a new, empty result container.java.util.stream.Stream<R>stream(C container)Returns a stream of result elements from the result container.
-
-
-
Method Detail
-
container
C container()
Returns a new, empty result container.- Returns:
- a new result container.
-
accumulate
void accumulate(C container, RowView rowView)
Accumulate data from the current row into the result container. Do not attempt to accumulate theRowViewitself into the result container--it is only valid within theaccumulate()method invocation. Instead, extract mapped types from the RowView by callingRowView.getRow()orRowView.getColumn()and store those values in the container.- Parameters:
container- the result containerrowView- row view over the current result set row.
-
-