HHH-16770 Only expand top level entity valued paths for group/order by
This commit is contained in:
parent
c24d1816d7
commit
bf55736a39
|
@ -256,7 +256,8 @@ public class EntityValuedPathInterpretation<T> extends AbstractSqmPathInterpreta
|
||||||
SqmToSqlAstConverter sqlAstCreationState) {
|
SqmToSqlAstConverter sqlAstCreationState) {
|
||||||
final boolean expandToAllColumns;
|
final boolean expandToAllColumns;
|
||||||
final Clause currentClause = sqlAstCreationState.getCurrentClauseStack().getCurrent();
|
final Clause currentClause = sqlAstCreationState.getCurrentClauseStack().getCurrent();
|
||||||
if ( currentClause == Clause.GROUP || currentClause == Clause.ORDER ) {
|
if ( sqlAstCreationState.getCurrentProcessingState().isTopLevel() &&
|
||||||
|
( currentClause == Clause.GROUP || currentClause == Clause.ORDER ) ) {
|
||||||
final SqmQuerySpec<?> querySpec = (SqmQuerySpec<?>) sqlAstCreationState.getCurrentSqmQueryPart();
|
final SqmQuerySpec<?> querySpec = (SqmQuerySpec<?>) sqlAstCreationState.getCurrentSqmQueryPart();
|
||||||
if ( currentClause == Clause.ORDER && !querySpec.groupByClauseContains( navigablePath ) ) {
|
if ( currentClause == Clause.ORDER && !querySpec.groupByClauseContains( navigablePath ) ) {
|
||||||
// We must ensure that the order by expression be expanded but only if the group by
|
// We must ensure that the order by expression be expanded but only if the group by
|
||||||
|
|
Loading…
Reference in New Issue