diff --git a/hibernate-core/src/main/java/org/hibernate/query/sqm/internal/AbstractSqmSelectionQuery.java b/hibernate-core/src/main/java/org/hibernate/query/sqm/internal/AbstractSqmSelectionQuery.java index 0c37e737355b..5f5e0cd0b577 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/sqm/internal/AbstractSqmSelectionQuery.java +++ b/hibernate-core/src/main/java/org/hibernate/query/sqm/internal/AbstractSqmSelectionQuery.java @@ -186,9 +186,6 @@ public SelectionQuery setOrder(List> orderList) { final SqmSelectStatement selectStatement = getSqmSelectStatement().copy( noParamCopyContext( SqmQuerySource.CRITERIA ) ); selectStatement.orderBy( orderList.stream().map( order -> sortSpecification( selectStatement, order ) ) .collect( toList() ) ); - // TODO: when the QueryInterpretationCache can handle caching criteria queries, - // simply cache the new SQM as if it were a criteria query, and remove this: - getQueryOptions().setQueryPlanCachingEnabled( false ); setSqmStatement( selectStatement ); return this; } @@ -198,9 +195,6 @@ public SelectionQuery setOrder(List> orderList) { public SelectionQuery setOrder(Order order) { final SqmSelectStatement selectStatement = getSqmSelectStatement().copy( noParamCopyContext( SqmQuerySource.CRITERIA ) ); selectStatement.orderBy( sortSpecification( selectStatement, order ) ); - // TODO: when the QueryInterpretationCache can handle caching criteria queries, - // simply cache the new SQM as if it were a criteria query, and remove this: - getQueryOptions().setQueryPlanCachingEnabled( false ); setSqmStatement( selectStatement ); return this; } @@ -209,9 +203,6 @@ public SelectionQuery setOrder(Order order) { public SelectionQuery addRestriction(Restriction restriction) { final SqmSelectStatement selectStatement = getSqmSelectStatement().copy( noParamCopyContext( SqmQuerySource.CRITERIA ) ); restriction.apply( selectStatement, selectStatement.getRoot( 0, getExpectedResultType() ) ); - // TODO: when the QueryInterpretationCache can handle caching criteria queries, - // simply cache the new SQM as if it were a criteria query, and remove this: - getQueryOptions().setQueryPlanCachingEnabled( false ); setSqmStatement( selectStatement ); return this; }