Sorry, I misread your question. You really want to do an ordering by expression rather than by column.
There is a thread on this. http://mail-archives.apache.org/mod_mbox/cayenne-user/201003.mbox/%[email protected]%3e The short answer is that it's not supported. There are a number of workarounds, depending on the specific query and how you need to use it. In your specific case, perhaps you could create a view containing A+B as an additional column and sort on that column. Or you can use an SQLTemplate to create the query. I believe there were other workarounds in the thread above. On Thu, Jul 22, 2010 at 2:13 PM, Mike Kienenberger <[email protected]> wrote: > http://cayenne.apache.org/doc30/using-orderings.html > > On Thu, Jul 22, 2010 at 1:45 PM, Martin Ludeiro > <[email protected]> wrote: >> I want to do an ordering expression with two columns, but i cant find >> the way >> >> The generated SQL must be something like "SELECT A, B FROM T ORDER BY A >> + B"; >> >> Sorry for my bad english >> Thanks in advance >> >
