cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mike Kienenberger <mkien...@gmail.com>
Subject Re: Ordering expression
Date Thu, 22 Jul 2010 18:19:58 GMT
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/%3Cdc5d39031003152211pad3d1advc5bb5c34562fbc62@mail.gmail.com%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 <mkienenb@gmail.com> wrote:
> http://cayenne.apache.org/doc30/using-orderings.html
>
> On Thu, Jul 22, 2010 at 1:45 PM, Martin Ludeiro
> <martin.ludeiro@gmail.com> 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
>>
>

Mime
View raw message