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