mirror of
https://github.com/hibernate/hibernate-orm
synced 2025-03-01 07:19:15 +00:00
HHH-16770 Only expand top level entity valued paths for group/order by
This commit is contained in:
parent
15310330f8
commit
8408849a50
@ -256,7 +256,8 @@ public static <T> EntityValuedPathInterpretation<T> from(
|
|||||||
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…
x
Reference in New Issue
Block a user