From d29cb697f9e459fcc8cd1f422a66050af9d36707 Mon Sep 17 00:00:00 2001 From: Marco Belladelli Date: Thu, 15 Feb 2024 11:56:40 +0100 Subject: [PATCH] HHH-17730 Account for immutable embedded ids during merge --- .../hibernate/event/internal/DefaultMergeEventListener.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hibernate-core/src/main/java/org/hibernate/event/internal/DefaultMergeEventListener.java b/hibernate-core/src/main/java/org/hibernate/event/internal/DefaultMergeEventListener.java index 83d686bc88..675c3de9ce 100644 --- a/hibernate-core/src/main/java/org/hibernate/event/internal/DefaultMergeEventListener.java +++ b/hibernate-core/src/main/java/org/hibernate/event/internal/DefaultMergeEventListener.java @@ -264,8 +264,7 @@ public class DefaultMergeEventListener copyValues[i] = subtype.deepCopy( propertyValues[i], sessionFactory ); } } - compositeType.setPropertyValues( idCopy, copyValues ); - return idCopy; + return compositeType.replacePropertyValues( idCopy, copyValues, session ); } protected void entityIsPersistent(MergeEvent event, MergeContext copyCache) {