From: <leg...@at...> - 2004-04-29 20:54:08
|
The following comment has been added to this issue: Author: Brad Koehn Created: Thu, 29 Apr 2004 4:01 PM Body: What about this: Build an aggregate class instead, that takes a criteria as a parameter. Similar to the Expression class, it would have static methods to build the aggregate functions: Criteria q; int count = Aggregate.count(q).execute(); String property; double sum = Aggregate.sum(q, property).execute(); In this way it's possible to use the Aggregates inside of criteria as well, to find the cats with more than 3 kittens, etc, by embedding these into an Expression object using eq, gt, ... (without calling execute, of course). That seems much more in tune with the existing Criteria API, and should solve a ton of problems. --------------------------------------------------------------------- View this comment: http://opensource.atlassian.com/projects/hibernate/browse/HB-474?page=comments#action_13028 --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/browse/HB-474 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-474 Summary: adding Criteria.count() method Type: Patch Status: Unassigned Priority: Major Original Estimate: Unknown Time Spent: Unknown Remaining: Unknown Project: Hibernate2 Components: core Versions: 2.1 2.1 rc1 Assignee: Reporter: Chris Nelson Created: Sun, 16 Nov 2003 12:53 PM Updated: Thu, 29 Apr 2004 4:01 PM Description: Adds a count() method to the Criteria class that does a modified query to return the count without returning entire query. --------------------------------------------------------------------- JIRA INFORMATION: This message is automatically generated by JIRA. If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |