Using java code, it is possible to sort german umlauts correctly with something like this:
Collections.sort(list, new Comparator<String>() {
Comparator umlautCollator = Collator.getInstance(Locale.GERMAN);
public int compare(String o1, String o2) {
return umlautCollator.compare(o1, o2);
}
});
I’d like to do such an order in my JPQL statement, without using a subsequent sort. Is it possible?
You need to make sure that your database supports Unicode collation for the character set that you are using, e.g. UTF-8. Java ddes Unicode by default which is why the comparator class works.
Presumably your database doesn’t – you’re probably using US-ASCII, right?
Recreate your database and convert your data is the hard answer.