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 67177fa553
commit 520538b23d
1 changed files with 3 additions and 0 deletions

View File

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