HHH-14567 Do not reuse query plans after session filters changed

This commit is contained in:
Yoann Rodière 2021-04-19 16:50:35 +02:00
parent 3bac846de2
commit 8389b1a7a2
1 changed files with 3 additions and 1 deletions

View File

@ -92,7 +92,9 @@ public class QueryImpl<R> extends AbstractProducedQuery<R> implements Query<R> {
if ( queryPlan != null ) {
queryParameters.setQueryPlan( queryPlan );
}
else if ( hql.equals( getQueryString() ) ) {
else if ( hql.equals( getQueryString() )
&& getQueryPlan().getEnabledFilterNames()
.equals( getProducer().getLoadQueryInfluencers().getEnabledFilters().values() ) ) {
queryParameters.setQueryPlan( getQueryPlan() );
}
}