public interface ExecutableStatement
Executable statement is a statement that has all parameters provided and is ready to be executed.
Modifier and Type | Method and Description |
---|---|
java.util.concurrent.CompletionStage<java.lang.Void> |
execute()
Executes this statement ignoring any resulting information.
|
java.util.concurrent.CompletionStage<java.lang.Void> |
execute(java.time.Duration timeout)
Executes this statement ignoring any resulting information.
|
java.util.concurrent.CompletionStage<java.util.Optional<Row>> |
executeForFirstRow()
Executes this statement and returns the first row returned by a database engine.
|
java.util.concurrent.CompletionStage<java.util.Optional<Row>> |
executeForFirstRow(java.time.Duration timeout)
Executes this statement and returns the first row returned by a database engine.
|
<T> java.util.concurrent.CompletionStage<T> |
executeForKey(java.lang.Class<T> keyType)
Executes this statement and returns a single generated key.
|
<T> java.util.concurrent.CompletionStage<T> |
executeForKey(java.lang.Class<T> keyType,
java.time.Duration timeout)
Executes this statement and returns a single generated key.
|
java.util.concurrent.CompletionStage<java.lang.Long> |
executeForRowsAffected()
Executes this statement returning a number of rows that were affected.
|
java.util.concurrent.CompletionStage<java.lang.Long> |
executeForRowsAffected(java.time.Duration timeout)
Executes this statement returning a number of rows that were affected.
|
java.util.concurrent.CompletionStage<ResultSet> |
executeForSet()
Executes this statement and returns a
ResultSet instance. |
java.util.concurrent.CompletionStage<ResultSet> |
executeForSet(java.time.Duration timeout)
Executes this statement and returns a
ResultSet instance. |
<T> java.util.concurrent.CompletionStage<java.util.Optional<T>> |
executeForValue(ThrowingFunction<Row,T> valExtractor)
Executes this statement and returns a single column value from the
first row returned by a database engine.
|
<T> java.util.concurrent.CompletionStage<java.util.Optional<T>> |
executeForValue(ThrowingFunction<Row,T> valExtractor,
java.time.Duration timeout)
Executes this statement and returns a single column value from the
first row returned by a database engine.
|
RowPublisher |
stream()
Executes this statement and returns a
RowPublisher instance
that can be used to stream rows from the database leveraging
Reactive Streams specification's Publisher with backpressure. |
RowPublisher |
stream(java.time.Duration timeout)
Executes this statement and returns a
RowPublisher instance
that can be used to stream rows from the database leveraging
Reactive Streams specification's Publisher with backpressure. |
RowPublisher stream(java.time.Duration timeout)
RowPublisher
instance
that can be used to stream rows from the database leveraging
Reactive Streams specification's Publisher
with backpressure.
After the operation takes longer time than timeout
, operation
will be aborted. Note however, that it may not be feasible
to abort the operation immediately.
Returned publisher can signal following error types:
UnauthorizedException
when client is not authorized to perform the actionInvalidQueryException
when query is rejected by a database engine as invalidInactiveTxException
when transaction is in progress but is in inactive stateConstraintViolationException
when operation results in an integrity constraint violationRowPublisher stream()
RowPublisher
instance
that can be used to stream rows from the database leveraging
Reactive Streams specification's Publisher
with backpressure.
Returned publisher can signal following error types:
UnauthorizedException
when client is not authorized to perform the actionInvalidQueryException
when query is rejected by a database engine as invalidInactiveTxException
when transaction is in progress but is in inactive stateConstraintViolationException
when operation results in an integrity constraint violationjava.util.concurrent.CompletionStage<java.lang.Void> execute(java.time.Duration timeout)
After the operation takes longer time than timeout
, operation
will be aborted. Note however, that it may not be feasible
to abort the operation immediately.
Returned CompletionStage
can fail with:
UnauthorizedException
when client is not authorized to perform the actionInvalidQueryException
when query is rejected by a database engine as invalidInactiveTxException
when transaction is in progress but is in inactive stateConstraintViolationException
when operation results in an integrity constraint violationjava.util.concurrent.CompletionStage<java.lang.Void> execute()
Returned CompletionStage
can fail with:
UnauthorizedException
when client is not authorized to perform the actionInvalidQueryException
when query is rejected by a database engine as invalidInactiveTxException
when transaction is in progress but is in inactive stateConstraintViolationException
when operation results in an integrity constraint violationjava.util.concurrent.CompletionStage<ResultSet> executeForSet(java.time.Duration timeout)
ResultSet
instance.
After execution all resulting rows will be pulled from a database and buffered in the resulting object. If expected result set is very big this may cause out of memory errors.
After the operation takes longer time than timeout
, operation
will be aborted. Note however, that it may not be feasible
to abort the operation immediately.
Returned CompletionStage
can fail with:
UnauthorizedException
when client is not authorized to perform the actionInvalidQueryException
when query is rejected by a database engine as invalidInactiveTxException
when transaction is in progress but is in inactive stateConstraintViolationException
when operation results in an integrity constraint violationjava.util.concurrent.CompletionStage<ResultSet> executeForSet()
ResultSet
instance.
Returned CompletionStage
can fail with:
UnauthorizedException
when client is not authorized to perform the actionInvalidQueryException
when query is rejected by a database engine as invalidInactiveTxException
when transaction is in progress but is in inactive stateConstraintViolationException
when operation results in an integrity constraint violationjava.util.concurrent.CompletionStage<java.lang.Long> executeForRowsAffected(java.time.Duration timeout)
After the operation takes longer time than timeout
, operation
will be aborted. Note however, that it may not be feasible
to abort the operation immediately.
Returned CompletionStage
can fail with:
UnauthorizedException
when client is not authorized to perform the actionInvalidQueryException
when query is rejected by a database engine as invalidInactiveTxException
when transaction is in progress but is in inactive stateConstraintViolationException
when operation results in an integrity constraint violationjava.util.concurrent.CompletionStage<java.lang.Long> executeForRowsAffected()
Returned CompletionStage
can fail with:
UnauthorizedException
when client is not authorized to perform the actionInvalidQueryException
when query is rejected by a database engine as invalidInactiveTxException
when transaction is in progress but is in inactive stateConstraintViolationException
when operation results in an integrity constraint violationjava.util.concurrent.CompletionStage<java.util.Optional<Row>> executeForFirstRow(java.time.Duration timeout)
If no rows are found, an empty Optional
will be returned.
After the operation takes longer time than timeout
, operation
will be aborted. Note however, that it may not be feasible
to abort the operation immediately.
Returned CompletionStage
can fail with:
UnauthorizedException
when client is not authorized to perform the actionInvalidQueryException
when query is rejected by a database engine as invalidInactiveTxException
when transaction is in progress but is in inactive stateConstraintViolationException
when operation results in an integrity constraint violationjava.util.concurrent.CompletionStage<java.util.Optional<Row>> executeForFirstRow()
If no rows are found, an empty Optional
will be returned.
Returned CompletionStage
can fail with:
UnauthorizedException
when client is not authorized to perform the actionInvalidQueryException
when query is rejected by a database engine as invalidInactiveTxException
when transaction is in progress but is in inactive stateConstraintViolationException
when operation results in an integrity constraint violation<T> java.util.concurrent.CompletionStage<java.util.Optional<T>> executeForValue(ThrowingFunction<Row,T> valExtractor, java.time.Duration timeout)
If no rows are found, an empty Optional
will be returned.
After the operation takes longer time than timeout
, operation
will be aborted. Note however, that it may not be feasible
to abort the operation immediately.
Returned CompletionStage
can fail with:
UnauthorizedException
when client is not authorized to perform the actionInvalidQueryException
when query is rejected by a database engine as invalidInactiveTxException
when transaction is in progress but is in inactive stateConstraintViolationException
when operation results in an integrity constraint violationvalExtractor
- function used to extract value from the returned row<T> java.util.concurrent.CompletionStage<java.util.Optional<T>> executeForValue(ThrowingFunction<Row,T> valExtractor)
If no rows are found, an empty Optional
will be returned.
Returned CompletionStage
can fail with:
UnauthorizedException
when client is not authorized to perform the actionInvalidQueryException
when query is rejected by a database engine as invalidInactiveTxException
when transaction is in progress but is in inactive stateConstraintViolationException
when operation results in an integrity constraint violationvalExtractor
- function used to extract value from the returned row<T> java.util.concurrent.CompletionStage<T> executeForKey(java.lang.Class<T> keyType, java.time.Duration timeout)
Returned CompletionStage
can fail with:
NoKeysReturnedException
when no keys were returned by the database engineNoSuitableConverterFoundException
when no suitable converter was found to transform key value to desired class instanceUnauthorizedException
when client is not authorized to perform the actionInvalidQueryException
when query is rejected by a database engine as invalidInactiveTxException
when transaction is in progress but is in inactive stateConstraintViolationException
when operation results in an integrity constraint violation<T> java.util.concurrent.CompletionStage<T> executeForKey(java.lang.Class<T> keyType)
Returned CompletionStage
can fail with:
NoKeysReturnedException
when no keys were returned by the database engineNoSuitableConverterFoundException
when no suitable converter was found to transform key value to desired class instanceUnauthorizedException
when client is not authorized to perform the actionInvalidQueryException
when query is rejected by a database engine as invalidInactiveTxException
when transaction is in progress but is in inactive stateConstraintViolationException
when operation results in an integrity constraint violation