Re: Order By Expression

From: Filipe Costa (nevco..mail.com)
Date: Tue Mar 16 2010 - 05:32:50 EDT

  • Next message: Michael Gentry: "Re: Order By Expression"

    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 <dombr..mail.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
    >



    This archive was generated by hypermail 2.0.0 : Tue Mar 16 2010 - 05:33:51 EDT