Hi Dave, Maybe you want something like this:
SelectQuery select = new SelectQuery(classE, restriction); select.addOrdering(orderBy, orderAscending); List<E> list = cayenneConnector.performQuery(select); See more at: http://cayenne.apache.org/doc20/using-orderings.html Hope that help. Cheers! On 16 March 2010 05:11, Dave Dombrosky <dom...@gmail.com> wrote: > Is there any way to use sort expressions in a query? Something like > "ORDER BY column = id"? I get the error "Unsupported ordering > expression" when trying to execute a query with this in it. > > Also, it looks like I might be able to do this using in-memory > sorting, but the Ordering(Expression sortExpression, ...) methods are > deprecated. So what's the preferred way to sort on expressions in > Cayenne? > > -Dave >