[jboss-user] [Persistence, JBoss/CMP, Hibernate, Database] - Query won't parse, why?
alexg79
do-not-reply at jboss.com
Tue Nov 27 12:01:04 EST 2007
I have the following named query:
| @NamedQuery(name = SalesOrderExtraChargeLine.QUERY_UNBILLED_DATERANGE, query =
| "SELECT el FROM SalesOrderExtraChargeLine el WHERE el.order.orderDate >= :startDate AND el.order.orderDate <= :endDate AND el.invoiceLines IS EMPTY AND NOT EXISTS (SELECT pl FROM SalesOrderProductLine pl WHERE pl.order = el.order AND pl.status <> :deliveredStatus)")
|
When I deploy the app, I get the following error:
| 17:57:06,287 WARN [ServiceController] Problem starting service persistence.units:ear=Etikettu.ear,jar=Etikettu-EJB.jar,unitName=etikettu
| java.lang.NullPointerException
| at org.hibernate.hql.ast.tree.FromClause.findIntendedAliasedFromElementBasedOnCrazyJPARequirements(FromClause.java:120)
| at org.hibernate.hql.ast.tree.FromClause.getFromElement(FromClause.java:107)
| at org.hibernate.hql.ast.tree.FromElementFactory.addFromElement(FromElementFactory.java:81)
| at org.hibernate.hql.ast.tree.FromClause.addFromElement(FromClause.java:70)
| at org.hibernate.hql.ast.HqlSqlWalker.createFromElement(HqlSqlWalker.java:255)
| at org.hibernate.hql.antlr.HqlSqlBaseWalker.fromElement(HqlSqlBaseWalker.java:3056)
| at org.hibernate.hql.antlr.HqlSqlBaseWalker.fromElementList(HqlSqlBaseWalker.java:2945)
| at org.hibernate.hql.antlr.HqlSqlBaseWalker.fromClause(HqlSqlBaseWalker.java:688)
| at org.hibernate.hql.antlr.HqlSqlBaseWalker.query(HqlSqlBaseWalker.java:544)
| at org.hibernate.hql.antlr.HqlSqlBaseWalker.collectionFunctionOrSubselect(HqlSqlBaseWalker.java:4253)
| at org.hibernate.hql.antlr.HqlSqlBaseWalker.comparisonExpr(HqlSqlBaseWalker.java:3968)
| at org.hibernate.hql.antlr.HqlSqlBaseWalker.logicalExpr(HqlSqlBaseWalker.java:1762)
| at org.hibernate.hql.antlr.HqlSqlBaseWalker.logicalExpr(HqlSqlBaseWalker.java:1737)
| at org.hibernate.hql.antlr.HqlSqlBaseWalker.logicalExpr(HqlSqlBaseWalker.java:1690)
| at org.hibernate.hql.antlr.HqlSqlBaseWalker.whereClause(HqlSqlBaseWalker.java:776)
| at org.hibernate.hql.antlr.HqlSqlBaseWalker.query(HqlSqlBaseWalker.java:577)
| at org.hibernate.hql.antlr.HqlSqlBaseWalker.selectStatement(HqlSqlBaseWalker.java:281)
| at org.hibernate.hql.antlr.HqlSqlBaseWalker.statement(HqlSqlBaseWalker.java:229)
| at org.hibernate.hql.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:228)
| at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:160)
| at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:111)
| at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:77)
| ...
|
SalesOrderProductLine and SalesOrderExtraChargeLine are both inherited from the same base entity (SalesOrderLine) using "JOINED" inheritance.
What am I doing wrong?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4108154#4108154
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4108154
More information about the jboss-user
mailing list