Andrus Adamchik created CAY-2836:
------------------------------------

             Summary: 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


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)

Reply via email to