4 Replies Latest reply on Aug 12, 2004 7:16 AM by Alexey Loubyansky

    ebjQl, ho do I get COUNT while using LIMIT/OFFSET

    Silvio Matthes Newbie

      Hi all,

      We're using LIMIT/OFFSET with DynamicQL in our JBoss-application for a complex query. That works fine.

      Now I want to know how many rows are in the full result.
      I know that JBoss does not send the LIMIT/OFFSET-clause to the database but handles this itself. So, JBoss should know how many rows are in this resultset.

      Is there ANY way to get this rowcount after executing the query?

      I know I could use COUNT with the query to get the desired value, but that would mean more load on the database, which is already the bottleneck.

      Versions used: JBoss 3.2.5
      PostgresQL 7.3.4
      The ejbQL-Query used: "SELECT OBJECT(d) FROM Document d ORDER BY d.archivierungAm DESC LIMIT ?1 OFFSET ?2"

      any help would be highly appreciated,

      Kind Regards,