From: <no...@at...> - 2005-05-31 08:06:22
|
The following issue has been updated: Updater: Christian Bauer (mailto:chr...@hi...) Date: Tue, 31 May 2005 3:06 AM Changes: Comment was deleted. --------------------------------------------------------------------- For a full history of the issue, see: http://opensource.atlassian.com/projects/hibernate/browse/HB-143?page=history --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/browse/HB-143 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-143 Summary: Criteria.count() and Query.count() Type: New Feature Status: Closed Priority: Minor Resolution: DUPLICATE Original Estimate: Unknown Time Spent: Unknown Remaining: Unknown Project: Hibernate2 Components: core Assignee: Reporter: Alexey Kaigorodov Created: Wed, 18 Jun 2003 10:53 PM Updated: Tue, 31 May 2005 3:06 AM Description: Add method count in classes Criteria and Query. Example: final int PAGE_SIZE; int position; ... Query query = ... // build complex query with many parameters int pageNum = position / PAGE_SIZE + 1; int pageCount = query.count() / PAGE_SIZE + 1; // <-- HERE System.out.println("Page " + pageNum + " from " + pageCount); query.setFirstResult(position); query.setMaxResults(PAGE_SIZE); List page = query.list(); System.out.println(page); Not necessary will twice create the similar Query or Criteria. By Criteria always easy build sql count query. For Query.count() throw exception if create sql count query impossible. --------------------------------------------------------------------- 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 |