title: How to do sort Chinese column in Hibernate?
body: <p>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: </p>
  
  <pre><code>String hql = "FROM CUSTOMER ORDER BY name DESC";
  </code></pre>
  
  <p>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 <strong>SQL</strong> like:</p>
  
  <pre><code>String sql = "SELECT * FROM customer ORDER BY convert(name using gbk) DESC";
  </code></pre>
  
  <p>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 (<strong>HQL</strong>) to query, so is there any way to do it? Or must I should develop a new database dialect to solve it?</p>
  
  <p>Thanks. </p>