From d914c8aabc7cecd311d468e2a4fa3508850d8ab8 Mon Sep 17 00:00:00 2001 From: Davide D'Alto Date: Thu, 14 May 2020 10:32:07 +0100 Subject: [PATCH] HHH-14027 Allow the creation of a different QueryLoader --- .../org/hibernate/hql/internal/ast/QueryTranslatorImpl.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 );