[jbossseam-issues] [JBoss JIRA] Updated: (JBSEAM-3643) "Group by" failed with paging
Pete Muir (JIRA)
jira-events at lists.jboss.org
Fri Oct 31 11:21:20 EDT 2008
[ https://jira.jboss.org/jira/browse/JBSEAM-3643?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Pete Muir updated JBSEAM-3643:
------------------------------
Fix Version/s: 2.1.1.CR1
Assignee: Dan Allen
> "Group by" failed with paging
> ------------------------------
>
> Key: JBSEAM-3643
> URL: https://jira.jboss.org/jira/browse/JBSEAM-3643
> Project: Seam
> Issue Type: Bug
> Components: Framework
> Affects Versions: 2.1.0.GA
> Environment: JBoss 4.2.3GA, Seam 2.1.0GA,JDK 1.5.0_16
> Reporter: Kenneth Zhang
> Assignee: Dan Allen
> Fix For: 2.1.1.CR1
>
> Attachments: Book-sample-2-log.txt, Book-sample-2.zip
>
>
> GroupBy is a new function at seam 2.1.0GA's Query module, but it cannot work with paging.
> This is the test code:
> @Name("bookStat")
> public class BookStat extends EntityQuery<Book> {
> private static final String EJBQL = "select name, count(*) from Book book";
> (snip)
> public BookStat() {
> setEjbql(EJBQL);
> setRestrictionExpressionStrings(Arrays.asList(RESTRICTIONS));
> setMaxResults(3);
> setGroupBy("name");
> }
> (snip)
> }
> There is the error log:
> 13:05:09,578 INFO [STDOUT] Hibernate:
> select
> count(*) as col_0_0_
> from
> test_seam.dbo.BOOK book0_
> group by
> book0_.name
> Caused by: javax.persistence.NonUniqueResultException: result returns 21 elements
> at org.hibernate.ejb.QueryImpl.getSingleResult(QueryImpl.java:85)
> at org.jboss.seam.framework.EntityQuery.initResultCount(EntityQuery.java:129)
> at org.jboss.seam.framework.EntityQuery.getResultCount(EntityQuery.java:120)
> at org.jboss.seam.framework.Query.getPageCount(Query.java:202)
> at org.jboss.seam.framework.Query.getLastFirstResult(Query.java:163)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the seam-issues
mailing list