Package org.hibernate.reactive.pool
Class BatchingConnection
java.lang.Object
org.hibernate.reactive.pool.BatchingConnection
- All Implemented Interfaces:
ReactiveConnection
A
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.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.hibernate.reactive.pool.ReactiveConnection
ReactiveConnection.Expectation, ReactiveConnection.Result -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclose()executeUnprepared(String sql) Run sql as statement (instead of preparedStatement)io.vertx.sqlclient.spi.DatabaseMetadata<T> CompletionStage<T>insertAndSelectIdentifier(String sql, Object[] paramValues, Class<T> idClass, String idColumnName) insertAndSelectIdentifierAsResultSet(String sql, Object[] paramValues, Class<?> idClass, String idColumnName) <T> CompletionStage<T>selectIdentifier(String sql, Object[] paramValues, Class<T> idClass) selectJdbc(String sql, Object[] paramValues) update(String sql, Object[] paramValues, boolean allowBatching, ReactiveConnection.Expectation expectation) CompletionStage<int[]>withBatchSize(int batchSize)
-
Constructor Details
-
BatchingConnection
-
-
Method Details
-
getDatabaseMetadata
public io.vertx.sqlclient.spi.DatabaseMetadata getDatabaseMetadata()- Specified by:
getDatabaseMetadatain interfaceReactiveConnection
-
withBatchSize
- Specified by:
withBatchSizein interfaceReactiveConnection
-
executeBatch
- Specified by:
executeBatchin interfaceReactiveConnection
-
update
public CompletionStage<Void> update(String sql, Object[] paramValues, boolean allowBatching, ReactiveConnection.Expectation expectation) - Specified by:
updatein interfaceReactiveConnection
-
execute
- Specified by:
executein interfaceReactiveConnection
-
executeUnprepared
Description copied from interface:ReactiveConnectionRun sql as statement (instead of preparedStatement)- Specified by:
executeUnpreparedin interfaceReactiveConnection
-
executeOutsideTransaction
- Specified by:
executeOutsideTransactionin interfaceReactiveConnection
-
update
- Specified by:
updatein interfaceReactiveConnection
-
update
- Specified by:
updatein interfaceReactiveConnection
-
update
- Specified by:
updatein interfaceReactiveConnection
-
insertAndSelectIdentifier
public <T> CompletionStage<T> insertAndSelectIdentifier(String sql, Object[] paramValues, Class<T> idClass, String idColumnName) - Specified by:
insertAndSelectIdentifierin interfaceReactiveConnection
-
insertAndSelectIdentifierAsResultSet
public CompletionStage<ResultSet> insertAndSelectIdentifierAsResultSet(String sql, Object[] paramValues, Class<?> idClass, String idColumnName) - Specified by:
insertAndSelectIdentifierAsResultSetin interfaceReactiveConnection
-
select
- Specified by:
selectin interfaceReactiveConnection
-
select
- Specified by:
selectin interfaceReactiveConnection
-
selectJdbc
- Specified by:
selectJdbcin interfaceReactiveConnection
-
selectIdentifier
- Specified by:
selectIdentifierin interfaceReactiveConnection
-
beginTransaction
- Specified by:
beginTransactionin interfaceReactiveConnection
-
commitTransaction
- Specified by:
commitTransactionin interfaceReactiveConnection
-
rollbackTransaction
- Specified by:
rollbackTransactionin interfaceReactiveConnection
-
close
- Specified by:
closein interfaceReactiveConnection
-