From: <leg...@at...> - 2003-10-29 17:19:21
|
The following comment has been added to this issue: Author: David Duffy Created: Wed, 29 Oct 2003 11:18 AM Body: I could certainly make great use of a Criteria.count() method for paging results and was hoping there already was one. --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-143 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-143 Summary: Criteria.count() and Query.count() Type: New Feature Status: Unassigned Priority: Minor Project: Hibernate2 Components: core Assignee: Reporter: Alexey Kaigorodov Created: Wed, 18 Jun 2003 10:53 PM Updated: Sat, 21 Jun 2003 3:26 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 |
From: <no...@at...> - 2005-05-31 07:38:20
|
The following comment has been added to this issue: Author: Shoaib Akhtar Created: Tue, 31 May 2005 2:38 AM Body: Hi, Why this issue is closed where is Query.count()? Regards, Shoaib Akhtar --------------------------------------------------------------------- View this comment: http://opensource.atlassian.com/projects/hibernate/browse/HB-143?page=comments#action_18000 --------------------------------------------------------------------- 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 2:38 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 |
From: <no...@at...> - 2005-06-01 04:36:59
|
The following comment has been added to this issue: Author: Shoaib Akhtar Created: Tue, 31 May 2005 11:36 PM Body: Hi, What is the problem with u Christian why are u deleting my comments ???? Why this issue is closed where is Query.count()? Regards, Shoaib Akhtar --------------------------------------------------------------------- View this comment: http://opensource.atlassian.com/projects/hibernate/browse/HB-143?page=comments#action_18024 --------------------------------------------------------------------- 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 11:36 PM 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 |
From: <no...@at...> - 2005-06-01 04:38:59
|
The following comment has been added to this issue: Author: Shoaib Akhtar Created: Tue, 31 May 2005 11:37 PM Body: Hi, Whats the problem with u Christian why are u deleting my question ???? Why this issue is closed where is Query.count()? Regards, Shoaib Akhtar --------------------------------------------------------------------- View this comment: http://opensource.atlassian.com/projects/hibernate/browse/HB-143?page=comments#action_18025 --------------------------------------------------------------------- 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 11:37 PM 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 |
From: <no...@at...> - 2005-06-01 04:47:01
|
The following comment has been added to this issue: Author: Gavin King Created: Tue, 31 May 2005 11:46 PM Body: This issue is closed. --------------------------------------------------------------------- View this comment: http://opensource.atlassian.com/projects/hibernate/browse/HB-143?page=comments#action_18026 --------------------------------------------------------------------- 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 11:46 PM 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 |