Description
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.
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)