-->
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.  [ 4 posts ] 
Author Message
 Post subject: count(*) for example query
PostPosted: Tue Oct 24, 2006 10:58 am 
Newbie

Joined: Tue Oct 24, 2006 7:03 am
Posts: 4
hi!

is there any count() function for getting count(*) from an example query which is generated by hibernate using createCriteria and Example.create???

Hibernate version:
3.x (26.04.2006)


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 24, 2006 1:20 pm 
Beginner
Beginner

Joined: Thu Sep 22, 2005 10:48 am
Posts: 30
Location: Rio de Janeiro, Brazil
Add in your criteria:

Code:
.setProjection( Projections.rowCount() )
.uniqueResult();


This return Integer (count) of your example


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 25, 2006 6:53 am 
Newbie

Joined: Tue Oct 24, 2006 7:03 am
Posts: 4
thx a lot!!!!!

this is what i was searching for!!!!!!!!!!

perfect!!


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 27, 2006 8:10 am 
Beginner
Beginner

Joined: Thu Sep 22, 2005 10:48 am
Posts: 30
Location: Rio de Janeiro, Brazil
If the answer did help you, please rate.

_________________
Please don't forget to rateME!


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.