Package org.apache.torque.util
Class ResultsetSpliterator<T>
java.lang.Object
java.util.Spliterators.AbstractSpliterator<T>
org.apache.torque.util.ResultsetSpliterator<T>
- All Implemented Interfaces:
Runnable,Spliterator<T>
public class ResultsetSpliterator<T>
extends Spliterators.AbstractSpliterator<T>
implements Runnable
Stream support: Encapsulate iteration over a JDBC ResultSet
- Author:
- Thomas Vandahl
-
Nested Class Summary
Nested classes/interfaces inherited from interface java.util.Spliterator
Spliterator.OfDouble, Spliterator.OfInt, Spliterator.OfLong, Spliterator.OfPrimitive<T,T_CONS, T_SPLITR extends Spliterator.OfPrimitive<T, T_CONS, T_SPLITR>> -
Field Summary
Fields inherited from interface java.util.Spliterator
CONCURRENT, DISTINCT, IMMUTABLE, NONNULL, ORDERED, SIZED, SORTED, SUBSIZED -
Constructor Summary
ConstructorsConstructorDescriptionResultsetSpliterator(RecordMapper<T> recordMapper, Criteria criteria, Statement statement, ResultSet resultSet) Constructor -
Method Summary
Modifier and TypeMethodDescriptionvoidrun()Method to be run onClose() of associated streambooleantryAdvance(Consumer<? super T> action) Methods inherited from class java.util.Spliterators.AbstractSpliterator
characteristics, estimateSize, trySplitMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Spliterator
forEachRemaining, getComparator, getExactSizeIfKnown, hasCharacteristics
-
Constructor Details
-
ResultsetSpliterator
public ResultsetSpliterator(RecordMapper<T> recordMapper, Criteria criteria, Statement statement, ResultSet resultSet) throws TorqueException Constructor- Parameters:
recordMapper- a RecordMapper to map ResultSet rows to entities of type Tcriteria- a Criteriastatement- the statement that created the ResultSetresultSet- the JDBC result set- Throws:
TorqueException- backend database exception
-
-
Method Details
-
tryAdvance
- Specified by:
tryAdvancein interfaceSpliterator<T>
-
run
public void run()Method to be run onClose() of associated stream
-