All, After needing and not finding the Criteria.count() method and then finding a request for it in JIRA, I went ahead and implemented it. Though there seems to be some dissension about this method, not having it meant I couldn't use the Criteria API in my application, and I suspect other folks are in the same boat.
I would like to submit it back to Hibernate. It looks like submitting a patch thru JIRA is the way to do it. I built my patch against what is currently checked into the v21branch and submitted it to JIRA as HB-474. I hope using the v21branch like this is the best practice. The downside is that there is a high potential for conflicts, since Hibernate is such a dynamic project. Also, I noticed that several unit tests did not pass for me using the CVS code. I ran the tests before and after my changes and the numbers of failing test cases were the same. Here's a brief outline of the classes I had to touch to implement this change: AbstractEntityLoader - needs to save the select statement it builds, so it now has a protected Select member CriteriaLoader adds a count() method that modifies this Select statement and runs it. Also refactored the list method to avoid duplicate code. Criteria adds the count method. CriteriaImpl adds this count method, which delegates to SessionImpl.count which delegates to CriteriaLoader.count. All this is modeled after the list method. Well, I hope this change can make it in. If someone has a better way to implement this, I'm willing to refactor this and resubmit it, time permitting of course. I'm also willing to help out to try to fit this code into whatever aggregate functionality develops if that makes sense. I think having that Select on AbstractEntityLoader may help implement aggregation, but that is a hopeful guess on my part. I have tested this with junit tests for my project. I can also create one in the Hibernate test area, but haven't done so yet. Thanks, Chris Nelson __________________________________ Do you Yahoo!? Protect your identity with Yahoo! Mail AddressGuard http://antispam.yahoo.com/whatsnewfree ------------------------------------------------------- This SF. Net email is sponsored by: GoToMyPC GoToMyPC is the fast, easy and secure way to access your computer from any Web browser or wireless device. Click here to Try it Free! https://www.gotomypc.com/tr/OSDN/AW/Q4_2003/t/g22lp?Target=mm/g22lp.tmpl _______________________________________________ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel