-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: how can I get row count on table
PostPosted: Fri Jan 12, 2007 8:39 am 
Newbie

Joined: Fri Dec 29, 2006 3:14 am
Posts: 5
Hi,

Using hibernate how can I query for count(*) on a oracle table?

Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 12, 2007 10:12 am 
Newbie

Joined: Tue Dec 19, 2006 11:05 am
Posts: 11
you can simply use a HQL query like 'select count(*) from MyEntity' if you want with a where. The result can be obtained by Query.uniqueResult(). The result can be cast to Long.

Please don't forget to vote ;-)


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.