You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@deltaspike.apache.org by Aleksandr Stserbakov - HELMES <Al...@helmes.ee> on 2015/05/26 13:31:36 UTC
order by multiple columns
Hi!
Is it a bug or a feature that deltaspike-data does not perform ordering by multiple columns?
I am using API
Criteria<E,E> orderAsc(SingularAttribute attr)
Criteria<E,E> orderDesc(SingularAttribute attr)
Something like this
return criteria().eq(MessageEntity_.receiver, example.getReceiver()).orderAsc(MessageEntity_.receiver).orderDesc(MessageEntity_.title).getResultList();
Final sql shows that order is performed only by the latest attribute, all earlier attributes are ignored.
Re: order by multiple columns
Posted by Daniel Cunha <da...@gmail.com>.
Hi Aleksandr,
https://issues.apache.org/jira/browse/DELTASPIKE-911
Thank you for reporting. :)
On Tue, May 26, 2015 at 9:59 AM, Daniel Cunha <da...@gmail.com> wrote:
> Hi Aleksandr,
>
> I looked quickly the implementation, since our process added one by one to
> CriteriaQuery, probably the previous ordering expressions will be replaced.
>
> But, we need to check! Can you open an issue?
>
> Thank for the feedback. :)
>
> On Tue, May 26, 2015 at 8:31 AM, Aleksandr Stserbakov - HELMES <
> Aleksandr.Stserbakov@helmes.ee> wrote:
>
>> Hi!
>>
>> Is it a bug or a feature that deltaspike-data does not perform ordering
>> by multiple columns?
>> I am using API
>>
>> Criteria<E,E> orderAsc(SingularAttribute attr)
>> Criteria<E,E> orderDesc(SingularAttribute attr)
>>
>> Something like this
>>
>> return criteria().eq(MessageEntity_.receiver,
>> example.getReceiver()).orderAsc(MessageEntity_.receiver).orderDesc(MessageEntity_.title).getResultList();
>>
>> Final sql shows that order is performed only by the latest attribute, all
>> earlier attributes are ignored.
>>
>>
>
>
> --
> Best regard,
> Daniel Cunha (soro)
>
--
Best regard,
Daniel Cunha (soro)
Re: order by multiple columns
Posted by Daniel Cunha <da...@gmail.com>.
Hi Aleksandr,
I looked quickly the implementation, since our process added one by one to
CriteriaQuery, probably the previous ordering expressions will be replaced.
But, we need to check! Can you open an issue?
Thank for the feedback. :)
On Tue, May 26, 2015 at 8:31 AM, Aleksandr Stserbakov - HELMES <
Aleksandr.Stserbakov@helmes.ee> wrote:
> Hi!
>
> Is it a bug or a feature that deltaspike-data does not perform ordering by
> multiple columns?
> I am using API
>
> Criteria<E,E> orderAsc(SingularAttribute attr)
> Criteria<E,E> orderDesc(SingularAttribute attr)
>
> Something like this
>
> return criteria().eq(MessageEntity_.receiver,
> example.getReceiver()).orderAsc(MessageEntity_.receiver).orderDesc(MessageEntity_.title).getResultList();
>
> Final sql shows that order is performed only by the latest attribute, all
> earlier attributes are ignored.
>
>
--
Best regard,
Daniel Cunha (soro)