@@ -44,10 +44,8 @@ public static <T> BasicValuedPathInterpretation<T> from(
44
44
SqmBasicValuedSimplePath <T > sqmPath ,
45
45
SqmToSqlAstConverter sqlAstCreationState ,
46
46
boolean jpaQueryComplianceEnabled ) {
47
- final FromClauseAccess fromClauseAccess = sqlAstCreationState .getFromClauseAccess ();
48
- final TableGroup tableGroup = fromClauseAccess .getTableGroup ( sqmPath .getNavigablePath ().getParent () );
49
-
50
47
final SqmPath <?> lhs = sqmPath .getLhs ();
48
+ final TableGroup tableGroup = sqlAstCreationState .getFromClauseAccess ().getTableGroup ( lhs .getNavigablePath () );
51
49
EntityMappingType treatTarget = null ;
52
50
final ModelPartContainer modelPartContainer ;
53
51
if ( lhs instanceof SqmTreatedPath <?, ?> ) {
@@ -87,7 +85,7 @@ public static <T> BasicValuedPathInterpretation<T> from(
87
85
final Clause currentClause = sqlAstCreationState .getCurrentClauseStack ().getCurrent ();
88
86
final SqmQueryPart <?> sqmQueryPart = sqlAstCreationState .getCurrentSqmQueryPart ();
89
87
if ( ( currentClause == Clause .GROUP || currentClause == Clause .SELECT || currentClause == Clause .ORDER || currentClause == Clause .HAVING )
90
- && sqmPath . getLhs () instanceof SqmFrom <?, ?>
88
+ && lhs instanceof SqmFrom <?, ?>
91
89
&& modelPartContainer .getPartMappingType () instanceof ManagedMappingType
92
90
&& sqmQueryPart .isSimpleQueryPart ()
93
91
&& sqmQueryPart .getFirstQuerySpec ().groupByClauseContains ( sqmPath .getNavigablePath () ) ) {
0 commit comments