Package org.hibernate.reactive.pool
Interface ReactiveConnection
-
- All Known Implementing Classes:
BatchingConnection
@Incubating public interface ReactiveConnection
Abstracts over reactive database connections, defining operations that allow queries to be executed asynchronously viaCompletionStage
.It is illegal to perform two non-blocking operations concurrently with a single
ReactiveConnection
. Instead, the second operation must be chained on completion of the first operation. This restriction might be relaxed in future, and is due to the implementation of theProxyConnection
.- See Also:
ReactiveConnectionPool
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
ReactiveConnection.Expectation
static interface
ReactiveConnection.Result
-
Method Summary
-
-
-
Method Detail
-
getDatabaseMetadata
io.vertx.sqlclient.spi.DatabaseMetadata getDatabaseMetadata()
-
execute
CompletionStage<Void> execute(String sql)
-
executeOutsideTransaction
CompletionStage<Void> executeOutsideTransaction(String sql)
-
executeUnprepared
CompletionStage<Void> executeUnprepared(String sql)
Run sql as statement (instead of preparedStatement)
-
update
CompletionStage<Integer> update(String sql)
-
update
CompletionStage<Integer> update(String sql, Object[] paramValues)
-
update
CompletionStage<Void> update(String sql, Object[] paramValues, boolean allowBatching, ReactiveConnection.Expectation expectation)
-
update
CompletionStage<int[]> update(String sql, List<Object[]> paramValues)
-
select
CompletionStage<ReactiveConnection.Result> select(String sql)
-
select
CompletionStage<ReactiveConnection.Result> select(String sql, Object[] paramValues)
-
selectJdbc
CompletionStage<ResultSet> selectJdbc(String sql, Object[] paramValues)
-
selectJdbcOutsideTransaction
CompletionStage<ResultSet> selectJdbcOutsideTransaction(String sql, Object[] paramValues)
This method is intended to be used only for queries returning a ResultSet that must be executed outside of any "current" transaction (i.e with autocommit=true). For example, it would be appropriate to use this method when performing queries on information_schema or system tables in order to obtain metadata information about catalogs, schemas, tables, etc.- Parameters:
sql
- - the query to execute outside of a transactionparamValues
- - a non-null array of parameter values- Returns:
- the CompletionStage
from executing the query.
-
insertAndSelectIdentifier
<T> CompletionStage<T> insertAndSelectIdentifier(String sql, Object[] paramValues, Class<T> idClass, String idColumnName)
-
insertAndSelectIdentifierAsResultSet
CompletionStage<ResultSet> insertAndSelectIdentifierAsResultSet(String sql, Object[] paramValues, Class<?> idClass, String idColumnName)
-
selectIdentifier
<T> CompletionStage<T> selectIdentifier(String sql, Object[] paramValues, Class<T> idClass)
-
beginTransaction
CompletionStage<Void> beginTransaction()
-
commitTransaction
CompletionStage<Void> commitTransaction()
-
rollbackTransaction
CompletionStage<Void> rollbackTransaction()
-
withBatchSize
ReactiveConnection withBatchSize(int batchSize)
-
executeBatch
CompletionStage<Void> executeBatch()
-
close
CompletionStage<Void> close()
-
-