cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Filipe Costa <nev...@gmail.com>
Subject Re: Order By Expression
Date Tue, 16 Mar 2010 09:32:50 GMT
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 <dombrd@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
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message