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
-
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:
getDatabaseMetadata
in interfaceReactiveConnection
-
withBatchSize
- Specified by:
withBatchSize
in interfaceReactiveConnection
-
executeBatch
- Specified by:
executeBatch
in interfaceReactiveConnection
-
update
public CompletionStage<Void> update(String sql, Object[] paramValues, boolean allowBatching, ReactiveConnection.Expectation expectation) - Specified by:
update
in interfaceReactiveConnection
-
execute
- Specified by:
execute
in interfaceReactiveConnection
-
executeUnprepared
Description copied from interface:ReactiveConnection
Run sql as statement (instead of preparedStatement)- Specified by:
executeUnprepared
in interfaceReactiveConnection
-
executeOutsideTransaction
- Specified by:
executeOutsideTransaction
in interfaceReactiveConnection
-
update
- Specified by:
update
in interfaceReactiveConnection
-
update
- Specified by:
update
in interfaceReactiveConnection
-
update
- Specified by:
update
in interfaceReactiveConnection
-
insertAndSelectIdentifier
public <T> CompletionStage<T> insertAndSelectIdentifier(String sql, Object[] paramValues, Class<T> idClass, String idColumnName) - Specified by:
insertAndSelectIdentifier
in interfaceReactiveConnection
-
insertAndSelectIdentifierAsResultSet
public CompletionStage<ResultSet> insertAndSelectIdentifierAsResultSet(String sql, Object[] paramValues, Class<?> idClass, String idColumnName) - Specified by:
insertAndSelectIdentifierAsResultSet
in interfaceReactiveConnection
-
select
- Specified by:
select
in interfaceReactiveConnection
-
select
- Specified by:
select
in interfaceReactiveConnection
-
selectJdbc
- Specified by:
selectJdbc
in interfaceReactiveConnection
-
selectIdentifier
- Specified by:
selectIdentifier
in interfaceReactiveConnection
-
beginTransaction
- Specified by:
beginTransaction
in interfaceReactiveConnection
-
commitTransaction
- Specified by:
commitTransaction
in interfaceReactiveConnection
-
rollbackTransaction
- Specified by:
rollbackTransaction
in interfaceReactiveConnection
-
close
- Specified by:
close
in interfaceReactiveConnection
-