You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cayenne.apache.org by "Nikita Timofeev (Jira)" <ji...@apache.org> on 2024/10/31 14:08:00 UTC

[jira] [Updated] (CAY-2836) ObjectSelect.selectCount() throws if a query contains ordering

     [ https://issues.apache.org/jira/browse/CAY-2836?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Nikita Timofeev updated CAY-2836:
---------------------------------
    Fix Version/s: 4.2.2
                   5.0-M2

> ObjectSelect.selectCount() throws if a query contains ordering
> --------------------------------------------------------------
>
>                 Key: CAY-2836
>                 URL: https://issues.apache.org/jira/browse/CAY-2836
>             Project: Cayenne
>          Issue Type: Bug
>    Affects Versions: 4.2
>            Reporter: Andrus Adamchik
>            Assignee: Nikita Timofeev
>            Priority: Minor
>             Fix For: 4.2.2, 5.0-M2
>
>
> This was reported to me privately. According to the report, when ObjectSelect has an ordering, "selectCount()" throws. While ordering should not be needed to retrieve a count, semantically there's nothing wrong with such a combo, and the query should not fail.
> {noformat}
> org.apache.cayenne.CayenneRuntimeException: [v.4.2 May 16 2023 08:31:12] Expected zero or one object, instead query matched: 54
> 	at org.apache.cayenne.BaseContext.selectOne(BaseContext.java:320)
> 	at org.apache.cayenne.query.FluentSelect.selectOne(FluentSelect.java:170)
> 	at org.apache.cayenne.query.ObjectSelect.selectCount(ObjectSelect.java:681)
> {noformat}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)