Package org.jdbi.v3.core.result.internal
Class ResultSetResultIterable<T>
java.lang.Object
org.jdbi.v3.core.result.internal.ResultSetResultIterable<T>
- All Implemented Interfaces:
Iterable<T>,ResultIterable<T>
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.jdbi.v3.core.result.ResultIterable
ResultIterable.ResultIteratorDelegate<T,R> -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionResultSetResultIterable(RowMapper<T> mapper, StatementContext ctx, Supplier<ResultSet> resultSetSupplier) -
Method Summary
Modifier and TypeMethodDescription<R extends Collection<? super T>>
RcollectInto(Type containerType) Collect the results into a container type.Returns results in aList.Returns results in aSet.iterator()Stream all the rows of the result set out with anIterator.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
spliteratorMethods inherited from interface org.jdbi.v3.core.result.ResultIterable
collect, collectInto, collectToMap, filter, findFirst, findOne, findOnly, first, forEach, forEachWithCount, list, map, one, reduce, set, stream, toCollection, useIterator, useStream, withIterator, withStream
-
Field Details
-
mapper
-
ctx
-
resultSetSupplier
-
-
Constructor Details
-
ResultSetResultIterable
public ResultSetResultIterable(RowMapper<T> mapper, StatementContext ctx, Supplier<ResultSet> resultSetSupplier)
-
-
Method Details
-
iterator
Description copied from interface:ResultIterableStream all the rows of the result set out with anIterator. TheIteratormust be closed to release database resources. -
collectInto
Description copied from interface:ResultIterableCollect the results into a container type.- Specified by:
collectIntoin interfaceResultIterable<T>- Parameters:
containerType- ATypeobject that must describe a container type- Returns:
- A new collection implementing the container type with all results inserted
-
collectIntoList
Description copied from interface:ResultIterableReturns results in aList. The implementation of the list can be changed by registering aCollector:
orjdbi.getConfig(JdbiCollectors.class).registerCollector(List.class, Collectors.toCollection(LinkedList::new));handle.registerCollector(List.class, Collectors.toCollection(LinkedList::new));
If no collector is registered, then this method behaves likeResultIterable.list().- Specified by:
collectIntoListin interfaceResultIterable<T>- Returns:
- results in a
List - See Also:
-
collectIntoSet
Description copied from interface:ResultIterableReturns results in aSet. The implementation of the set can be changed by registering aCollector:
orjdbi.getConfig(JdbiCollectors.class).registerCollector(Set.class, Collectors.toCollection(LinkedHashSet::new));handle.registerCollector(Set.class, Collectors.toCollection(LinkedHashSet::new));
If no collector is registered, then this method behaves likeResultIterable.set().- Specified by:
collectIntoSetin interfaceResultIterable<T>- Returns:
- results in a
Set - See Also:
-