1 Reply Latest reply on Jan 10, 2006 2:30 PM by Jim

    ejbql error

    Jim Newbie

      My environment:

      Windows XP sp2
      Eclipse v3.0.2
      MyEclipse v3.8.4
      JBoss v4.0.2

      I get the following after Jboss deploys my entity beans:

      15:14:16,609 INFO [STDOUT] org.jboss.ejb.plugins.cmp.ejbql.ParseException: Encountered "x.ID" at line 1, column 46.
      Was expecting one of:
      "NOT" ...
      "(" ...
      (rest of text omitted)

      Here is the offending finder method:

      @ejb.finder view-type="local"
      description="Component finder by id"
      signature="java.util.Collection findByID(com.xxx.model.ComponentPK ID)"
      query="Select OBJECT(x) FROM Component x WHERE x.ID = ?1"
      method-intf="LocalHome"

      Here is the get method for the attribute:

      /**
      * @ejb.interface-method view-type="both"
      * @ejb.persistence column-name="C_ID"
      *
      * @return Primary Key
      */
      public abstract com.xxx.model.ComponentPK getID();

      I get similar parse exception errors on all of the finder methods I defined on all my entity beans.

      I appreciate any insights you can give.

      Thanks.

        • 1. Re: ejbql error
          Jim Newbie

          I've got some additional information.

          It seems that the finder method that I define that refers to the primary key field is the one that is causing the problems. Below is the ejb bean definition:

          * @ejb.bean name="XHQComponent"
          * display-name="XHQComponent"
          * description="XHQ Component Entity Bean"
          * jndi-name="/ejb/ComponentHome"
          * local-jndi-name="/ejb/ComponentLocalHome"
          * type="CMP"
          * cmp-version="2.x"
          * primkey-field="ID"
          * view-type="both"

          The ID field is not a java.lang.Integer or an int: it is a specialized primary key class, ComponentPK:

          * @jboss.unknown-pk class="com.xxx.model.ComponentPK"
          * field-name="ID"
          * column-name="XC_ID"
          * jdbc-type="INTEGER"
          * sql-type="INTEGER"
          * auto-increment="true"

          Is there some specific JBoss XDoclet tag that is missing that will allow the ejbql parsing to succeed?