[
https://issues.apache.org/jira/browse/DELTASPIKE-714?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Gerhard Petracek updated DELTASPIKE-714:
----------------------------------------
Fix Version/s: 1.2.2
> 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
> Fix For: 1.2.2
>
>
> 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)