2 Replies Latest reply on Jan 2, 2006 11:47 AM by askesis

    What is wrong with my ejb-ql????

    askesis

      I have defined this query:

       * @ejb.finder signature = "nl.muntpost.interfaces.StockArticle findByArticle(java.lang.String articleObjectId)"
       * query = "SELECT OBJECT(c) FROM StockArticles AS c WHERE c.article = ?1"
      


      The bean has a attribute "article" (which is a relation

      If I deploy and use the bean I get the following exception:

      13:58:11,219 DEBUG [StockArticle#findByArticle] EJB-QL: SELECT OBJECT(c) FROM StockArticles AS c WHERE c.article = ?1
      13:58:11,223 INFO [STDOUT] org.jboss.ejb.plugins.cmp.ejbql.ParseException: Encountered "1" at line 1, column 60.
      Was expecting one of:
       <IDENTIFICATION_VARIABLE> ...
       <ENTITY_VALUED_PARAMETER> ...
       <ENTITY_VALUED_PATH> ...
      


      What is wrong with my ejb-eql?

      TIA

      Joost

        • 1. Re: What is wrong with my ejb-ql????
          askesis

          An addition: could it have anything to do with the fact the "article" is a CMR field (for which the table in which the StockArticles are stored has a column "article")?

          TIA

          Joost

          • 2. Re: What is wrong with my ejb-ql????
            askesis

            I have found the sollution of my problem. An ejb-ql query is (obvious??) not in terms of table.column but in terms of object.attribute. So the correct query is:

             * @ejb.finder signature = "nl.muntpost.interfaces.StockArticle findByArticle(java.lang.String article)"
             * query = "SELECT OBJECT(c) FROM StockArticles AS c WHERE c.article.objectId = ?1 "