[jboss-user] [JBoss Seam] - Re: How to use EntityManager for SELECT COUNT(1)?
Or you could try | SELECT count(a) FROM TableA | (untested) Regards Felix View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4074694#4074694 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4074694 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: How to use EntityManager for SELECT COUNT(1)?
count() returns a Long, not an Integer. View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4074731#4074731 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4074731 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: How to use EntityManager for SELECT COUNT(1)?
Thanks for all your help. You guys are the greatest. :-) View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4074989#4074989 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4074989 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: How to use EntityManager for SELECT COUNT(1)?
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(); | HTH. View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4074625#4074625 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4074625 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user