diff --git a/hibernate-core/src/main/java/org/hibernate/hql/internal/ast/QueryTranslatorImpl.java b/hibernate-core/src/main/java/org/hibernate/hql/internal/ast/QueryTranslatorImpl.java index 04ffbb52f0..7f655e9613 100644 --- a/hibernate-core/src/main/java/org/hibernate/hql/internal/ast/QueryTranslatorImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/hql/internal/ast/QueryTranslatorImpl.java @@ -210,7 +210,7 @@ public class QueryTranslatorImpl implements FilterTranslator { else { // PHASE 3 : Generate the SQL. generate( (QueryNode) sqlAst ); - queryLoader = new QueryLoader( this, factory, w.getSelectClause() ); + queryLoader = createQueryLoader( w, factory ); } compiled = true; @@ -245,6 +245,10 @@ public class QueryTranslatorImpl implements FilterTranslator { this.enabledFilters = null; } + protected QueryLoader createQueryLoader(HqlSqlWalker w, SessionFactoryImplementor factory) { + return new QueryLoader( this, factory, w.getSelectClause() ); + } + private void generate(AST sqlAst) throws QueryException, RecognitionException { if ( sql == null ) { final SqlGenerator gen = new SqlGenerator( factory );