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 org.hibernate.engine.jdbc.spi.JdbcCoordinator
and the org.hibernate.engine.jdbc.batch.spi.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 CompletionStage<Void> executeBatch()
executeBatch
in interface ReactiveConnection
public CompletionStage<Void> update(String sql, Object[] paramValues, boolean allowBatching, ReactiveConnection.Expectation expectation)
update
in interface ReactiveConnection
public CompletionStage<Void> execute(String sql)
execute
in interface ReactiveConnection
public CompletionStage<Void> executeOutsideTransaction(String sql)
executeOutsideTransaction
in interface ReactiveConnection
public CompletionStage<Integer> update(String sql)
update
in interface ReactiveConnection
public CompletionStage<Integer> update(String sql, Object[] paramValues)
update
in interface ReactiveConnection
public CompletionStage<int[]> update(String sql, List<Object[]> paramValues)
update
in interface ReactiveConnection
public CompletionStage<Long> updateReturning(String sql, Object[] paramValues)
updateReturning
in interface ReactiveConnection
public CompletionStage<ReactiveConnection.Result> select(String sql)
select
in interface ReactiveConnection
public CompletionStage<ReactiveConnection.Result> select(String sql, Object[] paramValues)
select
in interface ReactiveConnection
public CompletionStage<ResultSet> selectJdbc(String sql, Object[] paramValues)
selectJdbc
in interface ReactiveConnection
public CompletionStage<Long> selectLong(String sql, Object[] paramValues)
selectLong
in interface ReactiveConnection
public CompletionStage<Void> beginTransaction()
beginTransaction
in interface ReactiveConnection
public CompletionStage<Void> commitTransaction()
commitTransaction
in interface ReactiveConnection
public CompletionStage<Void> rollbackTransaction()
rollbackTransaction
in interface ReactiveConnection
public void close()
close
in interface ReactiveConnection