I want to select a number of objects with given ids but also in given order, something like:
<named-query name="getQuestionsByIds">
<query><![CDATA[from Question q where q.id in (:ids)]]></query>
</named-query>
But ordered the same way as ids in the parameter.
E.g. in mysql it can be done like this:
SELECT * FROM table ORDER BY FIELD( id, 23, 234, 543, 23 )
What is the best way?