HHH-17205 Avoid select by unique key with no referenced property

This commit is contained in:
Marco Belladelli 2023-09-18 16:11:34 +02:00
parent dcf1f1aa95
commit c021287296
1 changed files with 3 additions and 0 deletions

View File

@ -1725,6 +1725,9 @@ public class ToOneAttributeMapping
} }
private boolean isSelectByUniqueKey(ForeignKeyDescriptor.Nature side) { private boolean isSelectByUniqueKey(ForeignKeyDescriptor.Nature side) {
if ( referencedPropertyName == null ) {
return false;
}
if ( side == ForeignKeyDescriptor.Nature.KEY ) { if ( side == ForeignKeyDescriptor.Nature.KEY ) {
// case 1.2 // case 1.2
return !foreignKeyDescriptor.getNavigableRole() return !foreignKeyDescriptor.getNavigableRole()