[jboss-user] [JBoss Seam] - Re: How to use EntityManager for SELECT COUNT(1)?

2007-08-16 Thread fhh
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)?

2007-08-16 Thread [EMAIL PROTECTED]
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)?

2007-08-16 Thread tonylmai
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)?

2007-08-15 Thread fernando_jmt
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