hi
i need to implement a non-trivial order by clause in HQL, but looks like i can't really do anything more than just plain field names.
examples: 1. sort by "all the transactions that have specific credited account by parameter" (sorting by a boolean result - first all false values, then all true values) 2. sort by a different field that depends on certain parameters - similar to SQL "case... when... then... else... end" clause inside the order by, which returns for each case a different field / value. 3. sort by a @Transient function results - i guess this is not really possible as obviously the DB is not aware to transient fields, but maybe Hibernate is THAT smart? :]
in SQL this is possible to do, but i seem to have some trouble (and very little documentation to help!) implementing in HQL. any ideas?
Yuval
|