HHH-15359 The entity returned by a merge doesn't contain @ManyToMany relation when the collection resides in @Embeddable

This commit is contained in:
Andrea Boriero 2022-08-24 16:53:41 +02:00 committed by Andrea Boriero
parent 13bae2ef09
commit 84c276b3cc
1 changed files with 4 additions and 1 deletions

View File

@ -168,7 +168,7 @@ public class TypeHelper {
Object[] targetComponentValues = target[i] == null
? new Object[subtypes.length]
: componentType.getPropertyValues( target[i], session );
replaceAssociations(
final Object[] objects = replaceAssociations(
origComponentValues,
targetComponentValues,
subtypes,
@ -177,6 +177,9 @@ public class TypeHelper {
copyCache,
foreignKeyDirection
);
if ( target[i] != null && objects != null ) {
componentType.setPropertyValues( target[i], objects );
}
copied[i] = target[i];
}
else if ( !types[i].isAssociationType() ) {