EJBQLQuery and LEFT JOIN FETCH

From: David Marko (dmark..iscali.cz)
Date: Fri Feb 29 2008 - 16:30:57 EST


I have two tables (Issue and Reply) with 1:N relationship. I'm trying to
construct EJBQL query that would load issues and prefetch replies. I tried this
query: new EJBQLQuery("select a FROM Issue a LEFT JOIN FETCH a.replyArray")

.. but it throws error as below. Am I doing something wrong?

David

INFO - *** error.
java.lang.NullPointerException: Null entityId
        at org.apache.cayenne.access.jdbc.EJBQLTableId.<init>(EJBQLTableId.java:66)
        at org.apache.cayenne.access.jdbc.EJBQLTableId.<init>(EJBQLTableId.java:56)
        at
org.apache.cayenne.access.jdbc.EJBQLFromTranslator.visitOuterJoin(EJBQLFromTranslator.java:91)
        at
org.apache.cayenne.access.jdbc.EJBQLFromTranslator.visitOuterFetchJoin(EJBQLFromTranslator.java:86)
        at
org.apache.cayenne.ejbql.parser.EJBQLOuterFetchJoin.visitNode(EJBQLOuterFetchJoin.java:35)
        at org.apache.cayenne.ejbql.parser.SimpleNode.visit(SimpleNode.java:60)
        at org.apache.cayenne.ejbql.parser.SimpleNode.visitChild(SimpleNode.java:84)
        at org.apache.cayenne.ejbql.parser.EJBQLFrom.visitChild(EJBQLFrom.java:40)
        at org.apache.cayenne.ejbql.parser.SimpleNode.visit(SimpleNode.java:64)
        at
org.apache.cayenne.access.jdbc.EJBQLSelectTranslator.visitFrom(EJBQLSelectTranslator.java:68)
        at org.apache.cayenne.ejbql.parser.EJBQLFrom.visitNode(EJBQLFrom.java:35)
        at org.apache.cayenne.ejbql.parser.SimpleNode.visit(SimpleNode.java:60)
        at org.apache.cayenne.ejbql.parser.SimpleNode.visitChild(SimpleNode.java:84)
        at org.apache.cayenne.ejbql.parser.SimpleNode.visit(SimpleNode.java:64)
        at org.apache.cayenne.access.jdbc.EJBQLAction$1.visitSelect(EJBQLAction.java:73)
        at org.apache.cayenne.ejbql.parser.EJBQLSelect.visitNode(EJBQLSelect.java:35)
        at org.apache.cayenne.ejbql.parser.SimpleNode.visit(SimpleNode.java:60)
        at org.apache.cayenne.access.jdbc.EJBQLAction.performAction(EJBQLAction.java:67)
        at
org.apache.cayenne.access.DataNodeQueryAction.runQuery(DataNodeQueryAction.java:58)
        at org.apache.cayenne.access.DataNode.performQueries(DataNode.java:230)
        at
org.apache.cayenne.access.DataDomainQueryAction.runQuery(DataDomainQueryAction.java:442)
        at
org.apache.cayenne.access.DataDomainQueryAction.access$000(DataDomainQueryAction.java:67)
        at
org.apache.cayenne.access.DataDomainQueryAction$2.transform(DataDomainQueryAction.java:415)
        at org.apache.cayenne.access.DataDomain.runInTransaction(DataDomain.java:847)
        at
org.apache.cayenne.access.DataDomainQueryAction.runQueryInTransaction(DataDomainQueryAction.java:412)
        at
org.apache.cayenne.access.DataDomainQueryAction.execute(DataDomainQueryAction.java:119)
        at org.apache.cayenne.access.DataDomain.onQuery(DataDomain.java:740)
        at
org.apache.cayenne.util.ObjectContextQueryAction.runQuery(ObjectContextQueryAction.java:296)
        at
org.apache.cayenne.util.ObjectContextQueryAction.execute(ObjectContextQueryAction.java:84)
        at org.apache.cayenne.access.DataContext.onQuery(DataContext.java:1331)
        at org.apache.cayenne.access.DataContext.performQuery(DataContext.java:1320)
        at com.tcldig.citi_projects.setup.EjbTest1.main(EjbTest1.java:28)



This archive was generated by hypermail 2.0.0 : Fri Feb 29 2008 - 16:31:32 EST