4 Replies Latest reply on Apr 13, 2004 4:58 AM by Bogdan

    unable to use ORDER BY clause

    Daniel Du Newbie

      unable to use ORDER BY clause

      Platform: Jbuilder 9
      Server:jboss-3.0.3_tomcat-4.1.12

      i have to sort data by one column in a CMP.
      though i copy following statements from ejb-jar.xml to jbosscmp-jdbc.xml,
      these statements disappear after i rebuild the application.

      <query-method>
      <method-name>findByTypeID</method-name>
      <method-params>
      <method-param>java.lang.Integer</method-param>
      </method-params>
      </query-method>
      <ejb-ql>SELECT OBJECT(i) FROM TblWebInfo AS i WHERE i.infoTypeID=?1 ORDER BY i.pbulishTime DESC</ejb-ql>


      and system throws following information:
      actually that ejb-ql is used for another table, not TblWebProduct.

      Depends On Me: , ObjectName: jboss.j2ee:jndiName=TblWebProduct,service=EJB
      state: FAILED
      I Depend On:
      Depends On Me: org.jboss.deployment.DeploymentException: Error compiling ejbql;
      - nested throwable: (org.jboss.ejb.plugins.cmp.ejbql.ParseException: Encountere
      d "ORDER" at line 1, column 61.
      Was expecting one of:

      "AND" ...
      "OR" ...
      "+" ...
      "-" ...
      "*" ...
      "/" ...
      )]

      then how i can use ORDER BY clause in JBoss under Jbuilder9?
      I am appreciated if you can give me piece of advice.