Skip to content

Commit b455277

Browse files
committed
HHH-17415 Improved check for entity valued path expansion in subqueries
1 parent bc7746a commit b455277

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

hibernate-core/src/main/java/org/hibernate/query/sqm/sql/internal/EntityValuedPathInterpretation.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ private static boolean selectionContains(Selection<?> selection, NavigablePath p
384384
final SqmPath<?> sqmPath = (SqmPath<?>) selection;
385385
// Expansion is needed if the table group is null, i.e. we're in a top level query where EVPs are always
386386
// expanded to all columns, or if the selection is on the same table (lhs) as the group by expression ...
387-
return ( tableGroupPath == null || sqmPath.getLhs().getNavigablePath().equals( tableGroupPath ) )
387+
return ( tableGroupPath == null || sqmPath.getLhs() != null && sqmPath.getLhs().getNavigablePath().equals( tableGroupPath ) )
388388
// ... and if the entity valued path is selected or any of its columns are
389389
&& path.isParentOrEqual( sqmPath.getNavigablePath() );
390390
}

0 commit comments

Comments
 (0)