HHH-16355 Fix check for binding inverse many to many foreign key

This commit is contained in:
Marco Belladelli 2023-03-23 10:34:22 +01:00 committed by Christian Beikov
parent 01ce5c63f0
commit bee9ea6ae0
1 changed files with 3 additions and 1 deletions

View File

@ -2615,7 +2615,9 @@ public abstract class CollectionBinder {
AnnotatedJoinColumns joinColumns,
SimpleValue value,
boolean unique) {
if ( isUnownedCollection() ) {
// This method is also called for entity valued map keys, so we must consider
// the mappedBy of the join columns instead of the collection's one
if ( joinColumns.hasMappedBy() ) {
bindUnownedManyToManyInverseForeignKey( targetEntity, joinColumns, value );
}
else {