Does HQL determine the order of ownership?

How can I sort by a specific order of properties 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 does not allow inc order by.

Am I missing something? Is there any other way to solve this problem?

thank

+3
source share
2 answers

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

So, you have to figure out another way to do what you want without using this function.

You can find here all the function supported by HQL.

0
source

Don't raise a dead question, but

SELECT * FROM question q ORDER BY q.status IN ("DONE", "NO_ACTION"), q.status HAVING q.status IN ("NEW", "SAVED")

Find offer " "

0
source

Source: https://habr.com/ru/post/1745784/


All Articles