Skip to content

Commit

Permalink
Fix latest ORM 6.2 SNAPSHOT compilation errors
Browse files Browse the repository at this point in the history
* A parameter type has changed:

  from `Supplier<BatchKey>` to  `BatchKeyAccess`
  • Loading branch information
DavideD committed Mar 29, 2023
1 parent b5c8fe7 commit b1fe907
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -39,7 +38,7 @@ public class ReactiveMutationExecutorStandard extends MutationExecutorStandard i

public ReactiveMutationExecutorStandard(
MutationOperationGroup mutationOperationGroup,
Supplier<BatchKey> batchKeySupplier,
BatchKeyAccess batchKeySupplier,
int batchSize,
SharedSessionContractImplementor session) {
super( mutationOperationGroup, batchKeySupplier, batchSize, session );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -151,7 +150,7 @@ private CompletionStage<Void> deleteRows(
.thenCompose( CompletionStages::voidFuture );
}

private ReactiveMutationExecutor reactiveMutationExecutor(SharedSessionContractImplementor session, MutationOperationGroupSingle operationGroup, Supplier<BatchKey> batchKeySupplier) {
private ReactiveMutationExecutor reactiveMutationExecutor(SharedSessionContractImplementor session, MutationOperationGroupSingle operationGroup, BatchKeyAccess batchKeySupplier) {
final MutationExecutorService mutationExecutorService = session
.getFactory()
.getServiceRegistry()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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<BatchKey> batchKeySupplier,
BatchKeyAccess batchKeySupplier,
MutationOperationGroup operationGroup,
SharedSessionContractImplementor session) {
// decide whether to use batching - any number > one means to batch
Expand Down Expand Up @@ -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 );
}
Expand Down

0 comments on commit b1fe907

Please sign in to comment.