-
- Type Parameters:
T
- the type of the result of thisOperation
- All Superinterfaces:
Operation<T>
,ParameterizedOperation<T>
,PrimitiveOperation<T>
- All Known Subinterfaces:
MultiOperation<T>
public interface OutOperation<T> extends ParameterizedOperation<T>
AnParameterizedOperation
for which the result is a set of out parameter values and/or function results. As the SQL is vendor specific, how parameters are represented in the SQL is itself vendor specific.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description OutOperation<T>
apply(java.util.function.Function<Result.OutColumn,? extends T> processor)
Provide a processor that will handle the result of executing the SQL.OutOperation<T>
onError(java.util.function.Consumer<java.lang.Throwable> handler)
Provides an error handler for thisOperation
.OutOperation<T>
outParameter(java.lang.String id, SqlType type)
Register an out parameter identified by the given id.OutOperation<T>
set(java.lang.String id, java.lang.Object value)
Set a parameter value.OutOperation<T>
set(java.lang.String id, java.lang.Object value, SqlType type)
Set a parameter value.OutOperation<T>
set(java.lang.String id, java.util.concurrent.CompletionStage<?> source)
Set a parameter value to be the future value of aCompletionStage
.OutOperation<T>
set(java.lang.String id, java.util.concurrent.CompletionStage<?> source, SqlType type)
Set a parameter value to be the value of aCompletionStage
.OutOperation<T>
timeout(java.time.Duration minTime)
The minimum time before thisOperation
might be canceled automatically.-
Methods inherited from interface jdk.incubator.sql2.PrimitiveOperation
submit
-
-
-
-
Method Detail
-
outParameter
OutOperation<T> outParameter(java.lang.String id, SqlType type)
Register an out parameter identified by the given id.- Parameters:
id
- the parameter identifiertype
- the SQL type of the value of the parameter- Returns:
- this
OutOperation
- Throws:
java.lang.IllegalArgumentException
- if id is not a parameter marker in the SQLjava.lang.IllegalStateException
- if this method has been called previously on thisOperation
with the same id or thisOutOperation
has been submitted
-
apply
OutOperation<T> apply(java.util.function.Function<Result.OutColumn,? extends T> processor)
Provide a processor that will handle the result of executing the SQL.
-
onError
OutOperation<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.
-
set
OutOperation<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
OutOperation
-
set
OutOperation<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
OutOperation
-
set
OutOperation<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
OutOperation
-
set
OutOperation<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
OutOperation
-
timeout
OutOperation<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.
-
-