From 021500885184181972888402a324fa5ad063a5e4 Mon Sep 17 00:00:00 2001 From: Gail Badner Date: Wed, 18 Feb 2015 11:30:50 -0800 Subject: [PATCH] HHH-9621 : Add HQL query to warning about positional parameter usage --- .../java/org/hibernate/hql/internal/ast/HqlSqlWalker.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hibernate-core/src/main/java/org/hibernate/hql/internal/ast/HqlSqlWalker.java b/hibernate-core/src/main/java/org/hibernate/hql/internal/ast/HqlSqlWalker.java index 9ce4794de6..dab2ce8f45 100644 --- a/hibernate-core/src/main/java/org/hibernate/hql/internal/ast/HqlSqlWalker.java +++ b/hibernate-core/src/main/java/org/hibernate/hql/internal/ast/HqlSqlWalker.java @@ -994,10 +994,11 @@ public class HqlSqlWalker extends HqlSqlBaseWalker implements ErrorReporter, Par ); } LOG.warnf( - "[DEPRECATION] Encountered positional parameter near line %s, column %s. Positional parameter " + + "[DEPRECATION] Encountered positional parameter near line %s, column %s in HQL: [%s]. Positional parameter " + "are considered deprecated; use named parameters or JPA-style positional parameters instead.", inputNode.getLine(), - inputNode.getColumn() + inputNode.getColumn(), + queryTranslatorImpl.getQueryString() ); ParameterNode parameter = (ParameterNode) astFactory.create( PARAM, "?" ); PositionalParameterSpecification paramSpec = new PositionalParameterSpecification(