From fe1ff7a82900d9b8a1f9767b73c9cde9336a576d Mon Sep 17 00:00:00 2001 From: Andrea Boriero Date: Mon, 3 Oct 2022 17:21:46 +0200 Subject: [PATCH] HHH-15554 Merge of an Entity with an immutable composite user type throws NPE --- hibernate-core/src/main/java/org/hibernate/type/TypeHelper.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hibernate-core/src/main/java/org/hibernate/type/TypeHelper.java b/hibernate-core/src/main/java/org/hibernate/type/TypeHelper.java index 676589b4cc..5f8d0b5875 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/TypeHelper.java +++ b/hibernate-core/src/main/java/org/hibernate/type/TypeHelper.java @@ -207,7 +207,7 @@ public class TypeHelper { copyCache, foreignKeyDirection ); - if ( target[i] != null && objects != null ) { + if ( componentType.isMutable() && target[i] != null && objects != null ) { componentType.setPropertyValues( target[i], objects ); } copied[i] = target[i];