0 Replies Latest reply on Sep 13, 2005 5:16 PM by gressil

    @ejb.finder fails to deploy

    gressil

      Hi,

      I'm using JBoss-4.0.2 and I am having a problem deploying a CMP bean with the following finder:

      * @ejb.finder
       * query="SELECT OBJECT(a) FROM news AS a ORDER BY a.articleId DESC LIMIT 5"
       * signature="java.util.Collection findRecent()"

      This seems to generate the correct XML in ejb-jar.xml
      <query>
       <query-method>
       <method-name>findRecent</method-name>
       <method-params>
       </method-params>
       </query-method>
       <ejb-ql>[CDATA[SELECT OBJECT(a) FROM news AS a ORDER BY a.articleId DESC LIMIT 5]]</ejb-ql>
       </query>

      But when I deploy this I get
      21:57:18,935 WARN [ServiceController] Problem starting service jboss.j2ee:jndiName=ejb/remote/News,service=EJB
      org.jboss.deployment.DeploymentException: Error compiling EJB-QL statement 'SELECT OBJECT(a) FROM news AS a ORDER BY a.articleId DESC LIMIT 5'; - nested throwable: (org.jboss.ejb.plugins.cmp.ejbql.ParseException: Encountered "LIMIT" at line 1, column 59.
      

      I am right in thinking that LIMIT is now part of EJB-QL, aren't I?

      What am I doing wrong?

      TIA
      Chris.