| I guess the example you gave is not your actual query? Because ordering by CONCAT(:prefix, name) is as good as ordering by just the name, so you don't need the concat. If you also select the expression that you want to order by, you could instead order by the select alias. If that doesn't help, you will have to do your ordering in-memory instead i.e. use something like
List<Person> list = em.createQuery("SELECT p FROM Person p").getResultList();
Collections.sort(list, new Comparator<Person>() {
public int compare(Person p1, Person p2) {
return p1.getName().compareTo(p2.getName());
}
});
In the end you could still patch the SubselectFetch and build your own hibernate version if you really want this to work. |