tags:

views:

45

answers:

1

How can I order by a specific property order in HQL?

For MySQL I can use: SELECT * FROM question q ORDER BY q.status IN ("DONE", "NO_ACTION"), q.status IN ("NEW","SAVED"), q.created DESC

but HQL doesn't allow in in order by.

Am I missing something? Is there some other way around this problem?

Thanks

A: 

It seems to me that MySQL syntax using ORDER BY xxx IN (XXX,XXX...) is not SQL-ANSI supported function, it's a specific MySQL function.

So you should figure out another way to do what you want, by not using this function.

You can find here all the function supported by HQL.

zor
thanks Rasatavohary but I appreciate that this SQL is MySQL specific. I was hoping that some one could help with producing some HQL that would produce the same result. I have read the HQL manual and haven't seen something that is appropriate.
Austen