2 Replies Latest reply on Nov 22, 2003 8:48 AM by Wouter Zoons

    jboss-ql and COUNT(u)

    Wouter Zoons Newbie

      hello,

      I have been trying to get the COUNT feature to work, without success. I am using JBoss 3.2.2 w/ hypersonic and XDoclet for development, IMO the deployment descriptors and generated files are looking good, all other select and finders work fine...

      during deployment the container throws an EJB-QL parse exception

      I want to know the number of records in a specific table

      SELECT COUNT(u) FROM User As u

      exception: column 14, line 1 (encountered 'u')

      Is something wrong with this query ? I have tried a lot of other possibilities such as

      SELECT COUNT(u) FROM User
      SELECT COUNT(u) FROM User u
      SELECT COUNT(u) FROM User As x
      SELECT COUNT FROM User
      COUNT(u) FROM User As u

      etc... but none of them work neither

      I configured the bean in such a way that the query for EJB-QL is empty (ejb-jar.xml), and the COUNT query is a jboss-ql query (jbosscmp-jdbc.xml), because I assumed EJB-QL 2.1 (supporting the COUNT feature) was simply not yet working in JBoss 3.2.2 (probably it is just working fine), I then tried to use the JBOSS-QL COUNT feature and this error came up

      can anyone help me with this ? someone got the count feature to work ?

      thanks in advance
      Wouter.