Interface OutOperation<T>

    • 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 this Operation.
      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 a CompletionStage.
      OutOperation<T> set​(java.lang.String id, java.util.concurrent.CompletionStage<?> source, SqlType type)
      Set a parameter value to be the value of a CompletionStage.
      OutOperation<T> timeout​(java.time.Duration minTime)
      The minimum time before this Operation might be canceled automatically.
    • 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 identifier
        type - 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 SQL
        java.lang.IllegalStateException - if this method has been called previously on this Operation with the same id or this OutOperation 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.
        Parameters:
        processor - the Function that will be called to process the result of this OutOperation
        Returns:
        this OutOperation
        Throws:
        java.lang.IllegalStateException - if this method has been called previously on this Operation or this Operation has been submitted.
      • onError

        OutOperation<T> onError​(java.util.function.Consumer<java.lang.Throwable> handler)
        Provides an error handler for this Operation. If execution of this Operation results in an error, before the Operation is completed, the handler is called with the Throwable as the argument. The type of the Throwable is implementation dependent.
        Specified by:
        onError in interface Operation<T>
        Returns:
        this OutOperation
      • 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 the Operation is completed.
        Specified by:
        set in interface ParameterizedOperation<T>
        Parameters:
        id - the identifier of the parameter marker to be set
        value - 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 the Operation is completed.
        Specified by:
        set in interface ParameterizedOperation<T>
        Parameters:
        id - the identifier of the parameter marker to be set
        value - the value the parameter is to be set to
        type - 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 a CompletionStage. The Operation will not be executed until the CompletionStage is completed. This method allows submitting Operations that depend on the result of previous Operations rather than requiring that the dependent Operation be submitted only when the previous Operation completes. Use a default SQL type determined by the type of the value of the CompletionStage argument.
        Specified by:
        set in interface ParameterizedOperation<T>
        Parameters:
        id - the identifier of the parameter marker to be set
        source - the CompletionStage 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 a CompletionStage. The Operation will not be executed until the CompletionStage is completed. This method allows submitting Operations that depend on the result of previous Operations rather than requiring that the dependent Operation be submitted only when the previous Operation completes.
        Specified by:
        set in interface ParameterizedOperation<T>
        Parameters:
        id - the identifier of the parameter marker to be set
        source - the CompletionStage that provides the value the parameter is to be set to
        type - 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 this Operation 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 before minTime after the beginning of execution. Some time at least minTime after the beginning of execution, an attempt will be made to cancel the Operation if it has not yet completed. Implementations are encouraged to attempt to cancel within a reasonable time, though what is reasonable is implementation dependent.
        Specified by:
        timeout in interface Operation<T>
        Parameters:
        minTime - minimum time to wait before attempting to cancel
        Returns:
        this OutOperation