Skip to content

Commit 520538b

Browse files
committed
HHH-17205 Avoid select by unique key with no referenced property
1 parent 67177fa commit 520538b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

hibernate-core/src/main/java/org/hibernate/metamodel/mapping/internal/ToOneAttributeMapping.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1728,6 +1728,9 @@ private TableGroup createTableGroupForDelayedFetch(
17281728
}
17291729

17301730
private boolean isSelectByUniqueKey(ForeignKeyDescriptor.Nature side) {
1731+
if ( referencedPropertyName == null ) {
1732+
return false;
1733+
}
17311734
if ( side == ForeignKeyDescriptor.Nature.KEY ) {
17321735
// case 1.2
17331736
return !foreignKeyDescriptor.getNavigableRole()

0 commit comments

Comments
 (0)