2 Replies Latest reply on Feb 26, 2004 7:16 PM by kaypee

    Error compiling ejbql

    poorboy

      Hi.

      I'm trying to write a very simple query on JBoss 3.0.5, and am getting an "Error compiling ejbql".

      The error is as follows:

      Error compiling ejbql; - nested throwable: (org.jboss.ejb.plugins.cmp.ejbql.ParseException: Encountered "EJBSequences" at line 1, column 23.
      Was expecting one of:
      "IN" ...
      <ABSTRACT_SCHEMA> ...
      )]
      ...

      The query (in xdoclet) is as follows:
      * @ejb.finder
      * signature="com.bsl.Sequence findByName(java.lang.String name)"
      * query="SELECT OBJECT(o) FROM EJBSequences o WHERE name = ?1"
      * view-type="local"

      in ejb-jar.xml it is presented as:
      <ejb-ql>[CDATA[SELECT OBJECT(o) FROM EJBSequences o WHERE name = ?1]]</ejb-ql>

      It looks to me to follow the ejbql guidelines, and I've tried variations, but I continue to get the error shown above. No matter which way I look at it, I can't see that the IN keyword should be after FROM either.

      Can anyone tell me what I'm missing here?

        • 1. Re: Error compiling ejbql
          poorboy

          ok, replying to my own post...

          I was thinking in terms of Database - I should have been thinking in terms of JBoss.

          Rather than the database table name, the appropriate entry should have been <abstract-schema-name>, eg, the ejb name.

          HTH someone else...

          • 2. Re: Error compiling ejbql
            kaypee

            thanks for sharing this ...... it really did help me a lot!!!