0 Replies Latest reply on Aug 14, 2007 8:34 PM by tonylmai

    How to use EntityManager for SELECT COUNT(1)?

      Hello,

      Would someone help me on how to perform a "select count(1) from TableA"?

      I have the following code but that it does not seem to work.

      int rowCnt= (Integer) em.createQuery("SELECT count(1) FROM TableA").getSingleResult();


      I am using JBoss 4.2.1GA.

      Much appreciated.
      -tony