-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: HQL how to implement complex order by clauses?
PostPosted: Mon Sep 13, 2010 7:39 am 
Newbie

Joined: Sun Feb 14, 2010 10:13 am
Posts: 17
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.