diff --git a/hibernate-reactive-core/src/main/java/org/hibernate/reactive/engine/jdbc/mutation/internal/ReactiveMutationExecutorStandard.java b/hibernate-reactive-core/src/main/java/org/hibernate/reactive/engine/jdbc/mutation/internal/ReactiveMutationExecutorStandard.java index 3b3983fdc..e3d75a005 100644 --- a/hibernate-reactive-core/src/main/java/org/hibernate/reactive/engine/jdbc/mutation/internal/ReactiveMutationExecutorStandard.java +++ b/hibernate-reactive-core/src/main/java/org/hibernate/reactive/engine/jdbc/mutation/internal/ReactiveMutationExecutorStandard.java @@ -7,15 +7,14 @@ import java.sql.SQLException; import java.util.concurrent.CompletionStage; -import java.util.function.Supplier; -import org.hibernate.engine.jdbc.batch.spi.BatchKey; import org.hibernate.engine.jdbc.mutation.JdbcValueBindings; import org.hibernate.engine.jdbc.mutation.OperationResultChecker; import org.hibernate.engine.jdbc.mutation.TableInclusionChecker; import org.hibernate.engine.jdbc.mutation.group.PreparedStatementDetails; import org.hibernate.engine.jdbc.mutation.group.PreparedStatementGroup; import org.hibernate.engine.jdbc.mutation.internal.MutationExecutorStandard; +import org.hibernate.engine.jdbc.mutation.spi.BatchKeyAccess; import org.hibernate.engine.spi.SharedSessionContractImplementor; import org.hibernate.reactive.adaptor.impl.PrepareStatementDetailsAdaptor; import org.hibernate.reactive.adaptor.impl.PreparedStatementAdaptor; @@ -39,7 +38,7 @@ public class ReactiveMutationExecutorStandard extends MutationExecutorStandard i public ReactiveMutationExecutorStandard( MutationOperationGroup mutationOperationGroup, - Supplier batchKeySupplier, + BatchKeyAccess batchKeySupplier, int batchSize, SharedSessionContractImplementor session) { super( mutationOperationGroup, batchKeySupplier, batchSize, session ); diff --git a/hibernate-reactive-core/src/main/java/org/hibernate/reactive/persister/collection/mutation/ReactiveUpdateRowsCoordinatorOneToMany.java b/hibernate-reactive-core/src/main/java/org/hibernate/reactive/persister/collection/mutation/ReactiveUpdateRowsCoordinatorOneToMany.java index cc2bd097b..d230aa544 100644 --- a/hibernate-reactive-core/src/main/java/org/hibernate/reactive/persister/collection/mutation/ReactiveUpdateRowsCoordinatorOneToMany.java +++ b/hibernate-reactive-core/src/main/java/org/hibernate/reactive/persister/collection/mutation/ReactiveUpdateRowsCoordinatorOneToMany.java @@ -8,12 +8,11 @@ import java.lang.invoke.MethodHandles; import java.util.Iterator; import java.util.concurrent.CompletionStage; -import java.util.function.Supplier; import org.hibernate.collection.spi.PersistentCollection; import org.hibernate.engine.jdbc.batch.internal.BasicBatchKey; -import org.hibernate.engine.jdbc.batch.spi.BatchKey; import org.hibernate.engine.jdbc.mutation.JdbcValueBindings; +import org.hibernate.engine.jdbc.mutation.spi.BatchKeyAccess; import org.hibernate.engine.jdbc.mutation.spi.MutationExecutorService; import org.hibernate.engine.spi.SessionFactoryImplementor; import org.hibernate.engine.spi.SharedSessionContractImplementor; @@ -151,7 +150,7 @@ private CompletionStage deleteRows( .thenCompose( CompletionStages::voidFuture ); } - private ReactiveMutationExecutor reactiveMutationExecutor(SharedSessionContractImplementor session, MutationOperationGroupSingle operationGroup, Supplier batchKeySupplier) { + private ReactiveMutationExecutor reactiveMutationExecutor(SharedSessionContractImplementor session, MutationOperationGroupSingle operationGroup, BatchKeyAccess batchKeySupplier) { final MutationExecutorService mutationExecutorService = session .getFactory() .getServiceRegistry() diff --git a/hibernate-reactive-core/src/main/java/org/hibernate/reactive/sql/exec/internal/ReactiveStandardMutationExecutorService.java b/hibernate-reactive-core/src/main/java/org/hibernate/reactive/sql/exec/internal/ReactiveStandardMutationExecutorService.java index 4e6fa1ce2..3355febe5 100644 --- a/hibernate-reactive-core/src/main/java/org/hibernate/reactive/sql/exec/internal/ReactiveStandardMutationExecutorService.java +++ b/hibernate-reactive-core/src/main/java/org/hibernate/reactive/sql/exec/internal/ReactiveStandardMutationExecutorService.java @@ -6,11 +6,11 @@ package org.hibernate.reactive.sql.exec.internal; import java.util.Map; -import java.util.function.Supplier; import org.hibernate.cfg.Environment; import org.hibernate.engine.jdbc.batch.spi.BatchKey; import org.hibernate.engine.jdbc.mutation.MutationExecutor; +import org.hibernate.engine.jdbc.mutation.spi.BatchKeyAccess; import org.hibernate.engine.jdbc.mutation.spi.MutationExecutorService; import org.hibernate.engine.spi.SharedSessionContractImplementor; import org.hibernate.internal.util.config.ConfigurationHelper; @@ -47,7 +47,7 @@ public ReactiveStandardMutationExecutorService(int globalBatchSize) { //FIXME: It would be nice to have a factory to pass to the ORM method @Override public MutationExecutor createExecutor( - Supplier batchKeySupplier, + BatchKeyAccess batchKeySupplier, MutationOperationGroup operationGroup, SharedSessionContractImplementor session) { // decide whether to use batching - any number > one means to batch @@ -81,7 +81,7 @@ public MutationExecutor createExecutor( } final PreparableMutationOperation jdbcOperation = (PreparableMutationOperation) singleOperation; - final BatchKey batchKey = batchKeySupplier.get(); + final BatchKey batchKey = batchKeySupplier.getBatchKey(); if ( jdbcOperation.canBeBatched( batchKey, batchSizeToUse ) ) { return new ReactiveMutationExecutorSingleBatched( jdbcOperation, batchKey, batchSizeToUse, session ); }