NullPointerException on invalid HQL query with an extra brace
Description
Activity

Brett MeyerJuly 8, 2014 at 3:11 PM
Bulk rejecting stale issues. If this is still a legitimate issue on ORM 4, feel free to comment and attach a test case. I'll address responses case-by-case. Thanks!

Brett MeyerApril 7, 2014 at 5:41 PM
In an effort to clean up, in bulk, tickets that are most likely out of date, we're transitioning all ORM 3 tickets to an "Awaiting Test Case" state. Please see http://in.relation.to/Bloggers/HibernateORMJIRAPoliciesAndCleanUpTactics for more information.
If this is still a legitimate bug in ORM 4, please provide either a test case that reproduces it or enough detail (entities, mappings, snippets, etc.) to show that it still fails on 4. If nothing is received within 3 months or so, we'll be automatically closing them.
Thank you!

Jiří PejchalFebruary 11, 2011 at 6:51 PM
I've have been bitten by this issue as well. An extra parenthesis caused the problem: ":attributeName)"
. It would be helpful to log the name of the problematic parameter or other information that can be used to faster pinpoint the problem, nut just throw NullPonterException.

Geoffrey De SmetFebruary 21, 2008 at 12:47 PM
java.lang.NullPointerException
at org.hibernate.hql.ast.ParameterTranslationsImpl.getNamedParameterExpectedType(ParameterTranslationsImpl.java:63)
at org.hibernate.engine.query.HQLQueryPlan.buildParameterMetadata(HQLQueryPlan.java:296)
at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:97)
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)
It gives the NPE probably because it can't parse the p.soort parameter.
Details
Assignee
UnassignedUnassignedReporter
Geoffrey De SmetGeoffrey De SmetComponents
Affects versions
Priority
Trivial
Details
Details
Assignee
Reporter

This query:
"select p from IndividueleRekeningKasPO p left join fetch p.irTotalen inner join fetch p.toegangIndividueleRekeningKas tirkas where tirkas.authorityRef in (:authorityref)) and p.soort = :soort and p.id > 0"
gives a NPE. The strange thing is that this query executes:
"select p from IndividueleRekeningKasPO p left join fetch p.irTotalen inner join fetch p.toegangIndividueleRekeningKas tirkas where tirkas.authorityRef in (:authorityref)) and p.id > 0"
both are invalid, because there is a closing brace to much in "(:authorityref))".