HHH-18854 Allow HR to change DeleteOrUpsertOperation

This commit is contained in:
Davide D'Alto 2024-11-20 14:03:26 +01:00
parent 25790c26df
commit 5b3e06e534
No known key found for this signature in database
GPG Key ID: 163581B9C6E9FC17
1 changed files with 24 additions and 1 deletions

View File

@ -44,7 +44,6 @@ public class DeleteOrUpsertOperation implements SelfExecutingUpdateOperation {
private final OptionalTableUpdate optionalTableUpdate;
public DeleteOrUpsertOperation(
EntityMutationTarget mutationTarget,
EntityTableMapping tableMapping,
@ -56,6 +55,16 @@ public class DeleteOrUpsertOperation implements SelfExecutingUpdateOperation {
this.optionalTableUpdate = optionalTableUpdate;
}
/*
* Used by Hibernate Reactive
*/
protected DeleteOrUpsertOperation(DeleteOrUpsertOperation original) {
this.mutationTarget = original.mutationTarget;
this.tableMapping = original.tableMapping;
this.upsertOperation = original.upsertOperation;
this.optionalTableUpdate = original.optionalTableUpdate;
}
@Override
public MutationType getMutationType() {
return MutationType.UPDATE;
@ -197,4 +206,18 @@ public class DeleteOrUpsertOperation implements SelfExecutingUpdateOperation {
MODEL_MUTATION_LOGGER.tracef( "`%s` rows upserted into `%s`", rowCount, tableMapping.getTableName() );
}
/*
* Used by Hibernate Reactive
*/
public UpsertOperation getUpsertOperation() {
return upsertOperation;
}
/*
* Used by Hibernate Reactive
*/
public OptionalTableUpdate getOptionalTableUpdate() {
return optionalTableUpdate;
}
}