This content has been marked as final. Show 4 replies
If you're trying to execute an SQL (not JPA QL), just try with this:
int rowCnt= (Integer) em.createNativeQuery("SELECT count(1) FROM TableA").getSingleResult();
Or you could try
SELECT count(a) FROM TableA
count() returns a Long, not an Integer.
Thanks for all your help. You guys are the greatest. :-)