[
http://opensource.atlassian.com/projects/hibernate/browse/HHH-5080?page=c...
]
Gail Badner commented on HHH-5080:
----------------------------------
Here is the query taken from the log, with spacing added to make it readable:
SELECT COUNT(*)
FROM com.cicat.bedrock.billing.model.Invoice AS i
WHERE i.billingAccount = ba
AND i.state IN ( :paymentReceived, :posted )),
(SELECT SUM(i.total - i.paymentAmount)
FROM com.cicat.bedrock.billing.model.Invoice AS i
WHERE i.billingAccount = ba
AND i.state IN ( :paymentReceived, :posted )
AND i.dueDate >= :date1 ),
(SELECT SUM(i.total - i.paymentAmount)
FROM com.cicat.bedrock.billing.model.Invoice AS i
WHERE i.billingAccount = ba
AND i.state IN ( :paymentReceived, :posted )
AND i.dueDate >= :date2 AND i.dueDate < :date1 ),
(SELECT SUM(i.total - i.paymentAmount)
FROM com.cicat.bedrock.billing.model.Invoice AS i
WHERE i.billingAccount = ba
AND i.state IN ( :paymentReceived, :posted )
AND i.dueDate >= :date3
AND i.dueDate < :date2 ),
(SELECT SUM(i.total - i.paymentAmount)
FROM com.cicat.bedrock.billing.model.Invoice AS i
WHERE i.billingAccount = ba
AND i.state IN ( :paymentReceived, :posted )
AND i.dueDate >= :date4
AND i.dueDate < :date3 ),
(SELECT SUM(i.total - i.paymentAmount)
FROM com.cicat.bedrock.billing.model.Invoice AS i
WHERE i.billingAccount = ba
AND i.state IN ( :paymentReceived, :posted )
AND i.dueDate < :date4 ),
(SELECT SUM(i.total - i.paymentAmount)
FROM com.cicat.bedrock.billing.model.Invoice AS i
WHERE i.billingAccount = ba
AND i.state IN ( :paymentReceived, :posted ))
) WHERE (1=1)
The first SELECT statement is either missing a '(' at the beginning or it has an
extra ')' at the end,
The last SELECT has extra or misplaced ')'.
What was your original HQL query?
NPE when determining types of named parameters
----------------------------------------------
Key: HHH-5080
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-5080
Project: Hibernate Core
Issue Type: Bug
Components: core, query-hql
Affects Versions: 3.5.0-Final
Environment: sun java 6.0.19 runtime, hibernate 3.5.0-final using annotations,
mysql 5.0.75-0ubuntu10.3
Reporter: John Aylward
Attachments: hibernateLog.txt
Attached is the relevant hibernate log with the offending query.
Relevant stack trace:
java.lang.NullPointerException
at
org.hibernate.hql.ast.ParameterTranslationsImpl.getNamedParameterExpectedType(ParameterTranslationsImpl.java:87)
at
org.hibernate.engine.query.HQLQueryPlan.buildParameterMetadata(HQLQueryPlan.java:320)
at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:121)
at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:80)
at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:98)
at org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:156)
at org.hibernate.impl.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:135)
at org.hibernate.impl.SessionImpl.createQuery(SessionImpl.java:1760)
--
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