-
- Type Parameters:
T
- the type of the result of thisOperation
- All Superinterfaces:
Operation<T>
,PrimitiveOperation<T>
- All Known Subinterfaces:
ParameterizedRowOperation<T>
public interface RowOperation<T> extends Operation<T>
ARowOperation
is a database operation that returns a row sequence.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default <S extends T>
RowOperation<T>collect(java.util.function.Supplier<S> supplier, java.util.function.BiConsumer<S,Result.RowColumn> accumulator)
Convenience method to collect the rows when the accumulated result is the final result.<A,S extends T>
RowOperation<T>collect(java.util.stream.Collector<? super Result.RowColumn,A,S> c)
Provides aCollector
to reduce the sequence of rows.The result of theOperation
is the result of calling finisher on the final accumulated result.RowOperation<T>
fetchSize(long rows)
A hint to the implementation of how many rows to fetch in each database access.RowOperation<T>
onError(java.util.function.Consumer<java.lang.Throwable> handler)
Provides an error handler for thisOperation
.-
Methods inherited from interface jdk.incubator.sql2.PrimitiveOperation
submit
-
-
-
-
Method Detail
-
fetchSize
RowOperation<T> fetchSize(long rows) throws java.lang.IllegalArgumentException
A hint to the implementation of how many rows to fetch in each database access. Implementations are free to ignore it.- Parameters:
rows
- suggested number of rows to fetch per access- Returns:
- this
RowOperation
- Throws:
java.lang.IllegalArgumentException
- if row < 1java.lang.IllegalStateException
- if this method had been called previously or thisOperation
has been submitted.
-
collect
<A,S extends T> RowOperation<T> collect(java.util.stream.Collector<? super Result.RowColumn,A,S> c)
Provides aCollector
to reduce the sequence of rows.The result of theOperation
is the result of calling finisher on the final accumulated result. If theCollector
isCollector.Characteristics.UNORDERED
rows may be accumulated out of order. If theCollector
isCollector.Characteristics.CONCURRENT
then the sequence of rows may be split into subsequences that are reduced separately and then combined.- Type Parameters:
A
- the type of the accumulatorS
- the type of the final result- Parameters:
c
- the Collector. Notnull
.- Returns:
- This
RowOperation
- Throws:
java.lang.IllegalStateException
- if this method had been called previously or thisOperation
has been submitted.
-
collect
default <S extends T> RowOperation<T> collect(java.util.function.Supplier<S> supplier, java.util.function.BiConsumer<S,Result.RowColumn> accumulator)
Convenience method to collect the rows when the accumulated result is the final result.- Type Parameters:
S
- the type of the accumulated result- Parameters:
supplier
- supplies the accumulated resultaccumulator
- accumulates eachResult.RowColumn
into the accumulated result- Returns:
- this
RowOperation
-
onError
RowOperation<T> onError(java.util.function.Consumer<java.lang.Throwable> handler)
Provides an error handler for thisOperation
. If execution of thisOperation
results in an error, before theOperation
is completed, the handler is called with theThrowable
as the argument. The type of theThrowable
is implementation dependent.
-
-