Yes, the usual solution is to have a stored procedure for making temporary table and all. But the problem is that You cant have paging if you are using stored procedures in hibernate. But as you are using Oracle may be you can use the DECODE function. So you can write HQL like:
Code:
String HQL = "select c, c.parent from Child c left outer join fetch c.parent where c.name in ('E','X','A') order by decode(c.name, 'E', 1, 'X', 2, 'A', 3, 4)";
List lst = session.createQuery(HQL).setMaxResults(10).setFirstResult(0).list();