Skip to content

Commit 4c3d862

Browse files
committed
HHH-18854 Allow HR to change DeleteOrUpsertOperation
1 parent c5d9841 commit 4c3d862

File tree

1 file changed

+24
-1
lines changed

1 file changed

+24
-1
lines changed

hibernate-core/src/main/java/org/hibernate/sql/model/jdbc/DeleteOrUpsertOperation.java

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ public class DeleteOrUpsertOperation implements SelfExecutingUpdateOperation {
4444

4545
private final OptionalTableUpdate optionalTableUpdate;
4646

47-
4847
public DeleteOrUpsertOperation(
4948
EntityMutationTarget mutationTarget,
5049
EntityTableMapping tableMapping,
@@ -56,6 +55,16 @@ public DeleteOrUpsertOperation(
5655
this.optionalTableUpdate = optionalTableUpdate;
5756
}
5857

58+
/*
59+
* Used by Hibernate Reactive
60+
*/
61+
protected DeleteOrUpsertOperation(DeleteOrUpsertOperation original) {
62+
this.mutationTarget = original.mutationTarget;
63+
this.tableMapping = original.tableMapping;
64+
this.upsertOperation = original.upsertOperation;
65+
this.optionalTableUpdate = original.optionalTableUpdate;
66+
}
67+
5968
@Override
6069
public MutationType getMutationType() {
6170
return MutationType.UPDATE;
@@ -197,4 +206,18 @@ private void performUpsert(JdbcValueBindings jdbcValueBindings, SharedSessionCon
197206

198207
MODEL_MUTATION_LOGGER.tracef( "`%s` rows upserted into `%s`", rowCount, tableMapping.getTableName() );
199208
}
209+
210+
/*
211+
* Used by Hibernate Reactive
212+
*/
213+
public UpsertOperation getUpsertOperation() {
214+
return upsertOperation;
215+
}
216+
217+
/*
218+
* Used by Hibernate Reactive
219+
*/
220+
public OptionalTableUpdate getOptionalTableUpdate() {
221+
return optionalTableUpdate;
222+
}
200223
}

0 commit comments

Comments
 (0)