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.  [ 3 posts ] 
Author Message
 Post subject: New feature suggestion: ICriteria.Count()
PostPosted: Fri Sep 29, 2006 6:49 pm 
Beginner
Beginner

Joined: Wed Dec 28, 2005 3:14 pm
Posts: 29
My guess is that ICriteria.SetMaxResults( int maxResults ) and ICriteria.SetFirstResult( int firstResult ) is probably designed for the purpose of paging the result. However, I personaly think that only with a ICrtiera.Count() method, can ICriteria provide full paging support.

This Count method should return the count of the result records without query any more information from the database.
What do you think?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 29, 2006 11:55 pm 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
This was added to NHibernate 1.2 Beta1 in the form of projections for criterias. That way you can do count, avg, max, and whatever other aggregations you want.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Sep 30, 2006 4:51 pm 
Beginner
Beginner

Joined: Wed Dec 28, 2005 3:14 pm
Posts: 29
sergey wrote:
This was added to NHibernate 1.2 Beta1 in the form of projections for criterias. That way you can do count, avg, max, and whatever other aggregations you want.


Thanks very much!


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