facebook

ejbql error

  1. MyEclipse IDE
  2.  > 
  3. Off Topic
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #244113 Reply

    JimOHearn
    Member

    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.

    Is this an XDoclet configuration problem? I don’s see an ejbql syntax error here.

    I appreciate any insights you can give.

    Thanks.

    #244175 Reply

    Riyad Kalla
    Member

    Moving to OT > Soft Dev

    Should that statement just be SELECT x

    minus the parens?

    #244260 Reply

    JimOHearn
    Member

    Using SELECT x generates the following:

    Caused by: org.jboss.ejb.plugins.cmp.ejbql.ParseException: Encountered “x” at line 1, column 8.

    Was expecting one of:
    “DISTINCT” …
    “OBJECT” …
    “COUNT” …
    “MAX” …
    “MIN” …
    “AVG” …
    “SUM” …
    <NUMERIC_VALUED_PATH> …
    <STRING_VALUED_PATH> …
    <DATETIME_VALUED_PATH> …
    <BOOLEAN_VALUED_PATH> …
    <ENTITY_VALUED_PATH> …
    <VALUE_CLASS_VALUED_PATH> …

    I knew that the ejbql parser wouldn’t like that either, since SELECT needs to operate on something other than a variable (e.g. OBJECT(x) rather than x)

    I am still scratching my head on this. Could my problem be related to the version of JBoss or MyEclipse that I’m using?

    #244261 Reply

    Riyad Kalla
    Member

    It may be the version of JBoss. MyEclipse doesn’t mind, it’s all JavaDoc/XDoclet to it.

    I don’t keep up with the EJB spec so I don’t know what version supports which version of the QL, sorry.

Viewing 4 posts - 1 through 4 (of 4 total)
Reply To: ejbql error

You must be logged in to post in the forum log in