HHH-7023 - Deprecate HQL-specific (JDBC-style) positional parameters

This commit is contained in:
Steve Ebersole 2012-02-29 18:00:15 -06:00
parent 982aad716f
commit d66d335f29
1 changed files with 6 additions and 0 deletions

View File

@ -928,6 +928,12 @@ public class HqlSqlWalker extends HqlSqlBaseWalker implements ErrorReporter, Par
if ( namedParameters.size() > 0 ) {
throw new SemanticException( "cannot define positional parameter after any named parameters have been defined" );
}
LOG.warnf(
"[DEPRECATION] Encountered positional parameter near line %s, column %s. Positional parameter " +
"are considered deprecated; use named parameters or JPA-style positional parameters instead.",
inputNode.getLine(),
inputNode.getColumn()
);
ParameterNode parameter = ( ParameterNode ) astFactory.create( PARAM, "?" );
PositionalParameterSpecification paramSpec = new PositionalParameterSpecification(
inputNode.getLine(),