bad query results exposes IllegalArgumentException instead of an HibernateException
-----------------------------------------------------------------------------------
Key: HHH-2187
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-2187
Project: Hibernate3
Type: Bug
Components: query-hql
Reporter: Max Rydahl Andersen
s.createQuery("kkk");
results in an IllegalArgumentException being thrown making the exception bubble
through the expected catch HibernateException clauses in e.g. the tools.
Cause is:
public void traverseDepthFirst(AST ast) {
if ( ast == null ) {
throw new IllegalArgumentException( "node to traverse cannot be null!" );
}
visitDepthFirst( ast.getFirstChild() );
}
in NodeTraverser.
java.lang.IllegalArgumentException: node to traverse cannot be null!
at org.hibernate.hql.ast.util.NodeTraverser.traverseDepthFirst(NodeTraverser.java:31)
at org.hibernate.hql.ast.QueryTranslatorImpl.parse(QueryTranslatorImpl.java:254)
at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:157)
at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:111)
at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:77)
at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:56)
at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:72)
at org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:133)
at org.hibernate.impl.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:112)
at org.hibernate.impl.SessionImpl.createQuery(SessionImpl.java:1623)
at org.hibernate.console.HQLQueryPage.setSession(HQLQueryPage.java:103)
at org.hibernate.console.ConsoleConfiguration$3.execute(ConsoleConfiguration.java:309)
at
org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:56)
at
org.hibernate.console.ConsoleConfiguration.executeHQLQuery(ConsoleConfiguration.java:304)
at org.hibernate.eclipse.hqleditor.HQLEditor.executeQuery(HQLEditor.java:374)
at
org.hibernate.eclipse.console.actions.ExecuteQueryAction.execute(ExecuteQueryAction.java:72)
at
org.hibernate.eclipse.console.actions.ExecuteQueryAction.run(ExecuteQueryAction.java:52)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira