public class BatchingConnection extends Object implements ReactiveConnection
ReactiveConnection that automatically performs batching
of insert, update, and delete statements, relieving the client
persister code of the responsibility to manage batching. Actual
SQL statements are delegated to a given ReactiveConnection
which only supports explicit batching using update(String, List).
Note that in Hibernate core, the responsibilities of this class
are handled by JdbcCoordinator
and the Batch interface.
However, the model used there is not easily adaptable to the reactive
paradigm.
ReactiveConnection.Expectation, ReactiveConnection.Result| Constructor and Description |
|---|
BatchingConnection(ReactiveConnection delegate,
int batchSize) |
public BatchingConnection(ReactiveConnection delegate, int batchSize)
public ReactiveConnection withBatchSize(int batchSize)
withBatchSize in interface ReactiveConnectionpublic CompletionStage<Void> executeBatch()
executeBatch in interface ReactiveConnectionpublic CompletionStage<Void> update(String sql, Object[] paramValues, boolean allowBatching, ReactiveConnection.Expectation expectation)
update in interface ReactiveConnectionpublic CompletionStage<Void> execute(String sql)
execute in interface ReactiveConnectionpublic CompletionStage<Void> executeUnprepared(String sql)
ReactiveConnectionexecuteUnprepared in interface ReactiveConnectionpublic CompletionStage<Void> executeOutsideTransaction(String sql)
executeOutsideTransaction in interface ReactiveConnectionpublic CompletionStage<Integer> update(String sql)
update in interface ReactiveConnectionpublic CompletionStage<Integer> update(String sql, Object[] paramValues)
update in interface ReactiveConnectionpublic CompletionStage<int[]> update(String sql, List<Object[]> paramValues)
update in interface ReactiveConnectionpublic CompletionStage<Long> insertAndSelectIdentifier(String sql, Object[] paramValues)
insertAndSelectIdentifier in interface ReactiveConnectionpublic CompletionStage<ReactiveConnection.Result> select(String sql)
select in interface ReactiveConnectionpublic CompletionStage<ReactiveConnection.Result> select(String sql, Object[] paramValues)
select in interface ReactiveConnectionpublic CompletionStage<ResultSet> selectJdbc(String sql, Object[] paramValues)
selectJdbc in interface ReactiveConnectionpublic CompletionStage<ResultSet> selectJdbcOutsideTransaction(String sql, Object[] paramValues)
ReactiveConnectionselectJdbcOutsideTransaction in interface ReactiveConnectionsql - - the query to execute outside of a transactionparamValues - - a non-null array of parameter valuespublic CompletionStage<Long> selectIdentifier(String sql, Object[] paramValues)
selectIdentifier in interface ReactiveConnectionpublic CompletionStage<Void> beginTransaction()
beginTransaction in interface ReactiveConnectionpublic CompletionStage<Void> commitTransaction()
commitTransaction in interface ReactiveConnectionpublic CompletionStage<Void> rollbackTransaction()
rollbackTransaction in interface ReactiveConnectionpublic CompletionStage<Void> close()
close in interface ReactiveConnectionCopyright © 2020-2022 Red Hat, Inc. All Rights Reserved.