-
- Type Parameters:
T
- the type of the result of thisOperation
- All Superinterfaces:
Operation<T>
,ParameterizedOperation<T>
,PrimitiveOperation<T>
,RowOperation<T>
public interface ParameterizedRowOperation<T> extends ParameterizedOperation<T>, RowOperation<T>
An Operation that accepts parameters and processes a sequence of rows.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <A,S extends T>
ParameterizedRowOperation<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.ParameterizedRowOperation<T>
fetchSize(long rows)
A hint to the implementation of how many rows to fetch in each database access.ParameterizedRowOperation<T>
onError(java.util.function.Consumer<java.lang.Throwable> handler)
Provides an error handler for thisOperation
.ParameterizedRowOperation<T>
set(java.lang.String id, java.lang.Object value)
Set a parameter value.ParameterizedRowOperation<T>
set(java.lang.String id, java.lang.Object value, SqlType type)
Set a parameter value.ParameterizedRowOperation<T>
set(java.lang.String id, java.util.concurrent.CompletionStage<?> source)
Set a parameter value to be the future value of aCompletionStage
.ParameterizedRowOperation<T>
set(java.lang.String id, java.util.concurrent.CompletionStage<?> source, SqlType type)
Set a parameter value to be the value of aCompletionStage
.ParameterizedRowOperation<T>
timeout(java.time.Duration minTime)
The minimum time before thisOperation
might be canceled automatically.-
Methods inherited from interface jdk.incubator.sql2.PrimitiveOperation
submit
-
Methods inherited from interface jdk.incubator.sql2.RowOperation
collect
-
-
-
-
Method Detail
-
onError
ParameterizedRowOperation<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.
-
fetchSize
ParameterizedRowOperation<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.- Specified by:
fetchSize
in interfaceRowOperation<T>
- Parameters:
rows
- suggested number of rows to fetch per access- Returns:
- this
ParameterizedRowOperation
- Throws:
java.lang.IllegalArgumentException
- if row < 1
-
collect
<A,S extends T> ParameterizedRowOperation<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.- Specified by:
collect
in interfaceRowOperation<T>
- Type Parameters:
A
- the type of the accumulatorS
- the type of the final result- Parameters:
c
- the Collector. Notnull
.- Returns:
- this
ParameterizedRowOperation
-
set
ParameterizedRowOperation<T> set(java.lang.String id, java.lang.Object value, SqlType type)
Set a parameter value. The value is captured and should not be modified before theOperation
is completed.- Specified by:
set
in interfaceParameterizedOperation<T>
- Parameters:
id
- the identifier of the parameter marker to be setvalue
- the value the parameter is to be set totype
- the SQL type of the value to send to the database- Returns:
- this
ParameterizedRowOperation
-
set
ParameterizedRowOperation<T> set(java.lang.String id, java.util.concurrent.CompletionStage<?> source, SqlType type)
Set a parameter value to be the value of aCompletionStage
. TheOperation
will not be executed until theCompletionStage
is completed. This method allows submittingOperation
s that depend on the result of previousOperation
s rather than requiring that the dependentOperation
be submitted only when the previousOperation
completes.- Specified by:
set
in interfaceParameterizedOperation<T>
- Parameters:
id
- the identifier of the parameter marker to be setsource
- theCompletionStage
that provides the value the parameter is to be set totype
- the SQL type of the value to send to the database- Returns:
- this
ParameterizedRowOperation
-
set
ParameterizedRowOperation<T> set(java.lang.String id, java.util.concurrent.CompletionStage<?> source)
Set a parameter value to be the future value of aCompletionStage
. TheOperation
will not be executed until theCompletionStage
is completed. This method allows submittingOperation
s that depend on the result of previousOperation
s rather than requiring that the dependentOperation
be submitted only when the previousOperation
completes. Use a default SQL type determined by the type of the value of theCompletionStage
argument.- Specified by:
set
in interfaceParameterizedOperation<T>
- Parameters:
id
- the identifier of the parameter marker to be setsource
- theCompletionStage
that provides the value the parameter is to be set to- Returns:
- this
ParameterizedRowOperation
-
set
ParameterizedRowOperation<T> set(java.lang.String id, java.lang.Object value)
Set a parameter value. Use a default SQL type determined by the type of the value argument. The value is captured and should not be modified before theOperation
is completed.- Specified by:
set
in interfaceParameterizedOperation<T>
- Parameters:
id
- the identifier of the parameter marker to be setvalue
- the value the parameter is to be set to- Returns:
- this
ParameterizedRowOperation
-
timeout
ParameterizedRowOperation<T> timeout(java.time.Duration minTime)
The minimum time before thisOperation
might be canceled automatically. The default value is forever. The time is counted from the beginning of Operation execution. The Operation will not be canceled beforeminTime
after the beginning of execution. Some time at leastminTime
after the beginning of execution, an attempt will be made to cancel theOperation
if it has not yet completed. Implementations are encouraged to attempt to cancel within a reasonable time, though what is reasonable is implementation dependent.
-
-