You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@deltaspike.apache.org by "Thomas Hug (JIRA)" <ji...@apache.org> on 2015/01/23 10:41:34 UTC
[jira] [Resolved] (DELTASPIKE-714) QueryResult.count not work if
jpql have order by
[ https://issues.apache.org/jira/browse/DELTASPIKE-714?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Thomas Hug resolved DELTASPIKE-714.
-----------------------------------
Resolution: Fixed
> QueryResult.count not work if jpql have order by
> ---------------------------------------------------
>
> Key: DELTASPIKE-714
> URL: https://issues.apache.org/jira/browse/DELTASPIKE-714
> Project: DeltaSpike
> Issue Type: Bug
> Components: Data-Module
> Affects Versions: 1.0.2
> Reporter: chunlinyao
> Assignee: Thomas Hug
>
> I have a entity which have a field scannedDate, create a repository with method findByXXX() which return a QueryResult.
> If I call QueryResult.orderAsc("scannedDate").count(), this error will happen.
> ERROR: column "t0.scanneddate" must appear in the GROUP BY clause or be used in an aggregate function
> I use openjpa 2.2, We cannot simply remove the "order by", Because if we order by a attribute of associated entity like order by e.foo.bar, JPA engine will generate a inner join, if we simply remove the "order by" the count result will not correct.
> Maybe this is not a bug, just a limitation.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)