Page 1 of 1

Ordering entities

PostPosted: Mon Apr 16, 2018 8:44 am
by mdw
QxORM offers two types of methods to sort columns: orderByAsc() and orderByDesc(). Unfortunately at least with SQLite you are not able to mix them since the ORDER BY SQL clause is generated twice.

e.g. query.OrderAsc(id).OrderDesc(Name) generates ORDER BY id ASC ORDER BY Name DESC.

Re: Ordering entities

PostPosted: Mon Apr 16, 2018 1:09 pm
by qxorm
Hello,

You can resolve this issue using the qx::QxSqlQuery::freeText() method (instead of OrderAsc or OrderDesc).

Example :
Code: Select all
query.freeText("ORDER BY XXXXXXXXX");

Re: Ordering entities

PostPosted: Tue Apr 17, 2018 7:45 am
by mdw
Yeah, I am using this work-around already 8-).