4 Replies Latest reply on Sep 25, 2003 12:01 AM by uuu

    Unknown cmr field error with Collection cmr

    uuu

      hi!
      I try to execute the following EJBQL query to get the collection of objects
      SELECT OBJECT(r) FROM Rest r, IN(r.restParts) as rp WHERE rp.posting.id = 1
      Rest is an entity bean that has a relation to another entity bean RestPart.
      Rest is the "One" side of the relation and RestPart is "Many" side.
      Rest has 2 relation methods

      public abstract Collection getRestParts();
      public abstract void setRestParts(Collection param);

      RestPart has one-to-one relation to the third bean - Posting
      RestPart has 2 relation methods

      public abstract PostingLocal getPosting();
      public abstract void setPosting(PostingLocal param);



      In ejb-jar.xml and jbosscmp-jdbc.xml all relations configuration is present.
      The above query is the query for finder method

      public java.util.Collection findRests() throws javax.ejb.FinderException;


      And after all this I get the following error at deployment

      ; - nested throwable: (org.jboss.ejb.plugins.cmp.ejbql.UnknownPathException: Unknown cmr field in path: at line 1, column 129. Encountered: "posting" after: "rp."

      Is this a bug?
      Or my query is wrong?

      Please help