Skip to content

HHH-17002 enable use of query plan cache for Jakarta Data Orders and Restrictions #10021

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,6 @@ public SelectionQuery<R> setOrder(List<? extends Order<? super R>> orderList) {
final SqmSelectStatement<R> 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;
}
Expand All @@ -198,9 +195,6 @@ public SelectionQuery<R> setOrder(List<? extends Order<? super R>> orderList) {
public SelectionQuery<R> setOrder(Order<? super R> order) {
final SqmSelectStatement<R> 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;
}
Expand All @@ -209,9 +203,6 @@ public SelectionQuery<R> setOrder(Order<? super R> order) {
public SelectionQuery<R> addRestriction(Restriction<? super R> restriction) {
final SqmSelectStatement<R> selectStatement = getSqmSelectStatement().copy( noParamCopyContext( SqmQuerySource.CRITERIA ) );
restriction.apply( selectStatement, selectStatement.<R>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;
}
Expand Down