4 Replies Latest reply on Jul 21, 2002 1:02 AM by Roland Chan

    ejb-ql w/ cmr-field question

    Roland Chan Newbie

      Hi gang,

      I've become quite comfortable now doing ejb-ql with straight cmp-fields, however, am needing some help in the cmr area. No problems on the one side of cmr relationships, it's the many I need some aid in. I've tried scouring the forum, and I even bought Dain's doc -- :)

      Let us say I have an order bean with the following xdoclet specified ejb-ql query:

      @ejb:finder signature="java.util.Collection findByLineItemId(java.lang.Integer lineItemId)"
      query="SELECT OBJECT(o) FROM Orders o, WHERE o.lineitem = ?1"

      lineitem is a cmr-field on the many side of the cmr relationship where Orders is the relationship-role-source. The generated ejb-jar.xml looks good. I can attach if this helps, but I'm certain this is just a fundamental misunderstanding on my part on how to query cmr-fields in ejb-ql.

      Although the this seemingly looks correct to myself, I am encountered with this error:

      21:43:03,343 ERROR [EjbModule] Starting failed
      org.jboss.deployment.DeploymentException: Error compiling ejbql; - nested throwa
      ble: (org.jboss.ejb.plugins.cmp.ejbql.ParseException: Encountered "" at lin
      e 1, column 54.
      Was expecting one of:
      "IN" ...
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCEJBQLQuery.(JDBCEJBQLQuery.j

      I've specified my abstract schema as being Orders. I'm looking for any guidance here. Thanks.


      PS - I've gotten the latest xdoclet from cvs which is supposed to provide jbossql support. Anyone have any strong feelings against using xdoclet as descriptor and interface generator? I've read in many places that this is bad practice.