I got a problem when I was sorting customer list for the Chinese column with Hibernate, firstly, I tried to sort them by the simple HQL:
String hql = "FROM CUSTOMER ORDER BY name DESC";
I found the retrieved list didn't meet our requirement, I want to sort them with 26 letter spells, and then I googled the solution that it can be solved by SQL like:
String sql = "SELECT * FROM customer ORDER BY convert(name using gbk) DESC";
I posted it on MySQL command line and it selected the right-sorting result, but right now It still doesn't solve my problem since It doesn't work in Hibernate and I just want to use Hibernate (HQL) to query, so is there any way to do it? Or must I should develop a new database dialect to solve it?
Thanks.