diff --git a/hibernate-core/src/main/java/org/hibernate/query/sqm/sql/BaseSqmToSqlAstConverter.java b/hibernate-core/src/main/java/org/hibernate/query/sqm/sql/BaseSqmToSqlAstConverter.java index 4258c72745..ffc6d09a05 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/sqm/sql/BaseSqmToSqlAstConverter.java +++ b/hibernate-core/src/main/java/org/hibernate/query/sqm/sql/BaseSqmToSqlAstConverter.java @@ -3259,7 +3259,7 @@ public abstract class BaseSqmToSqlAstConverter extends Base // then we want to return the PluralTableGroup instead if ( lhsTableGroup instanceof PluralTableGroup && !( path instanceof SqmPluralPartJoin ) - && CollectionPart.Nature.fromName( path.getNavigablePath().getLocalName() ) == null ) { + && CollectionPart.Nature.fromNameExact( path.getNavigablePath().getLocalName() ) == null ) { final TableGroup elementTableGroup = ( (PluralTableGroup) lhsTableGroup ).getElementTableGroup(); // The element table group could be null for basic collections if ( elementTableGroup != null ) {