title: Convert string to int in Hibernate order criterion
body: <p>Basically, my question is the same as this one, but for Java's (JBoss) Hibernate:  <a href="https://stackoverflow.com/questions/2871131/how-can-we-order-a-column-as-int-using-hibernate-criteria-api">How can we order a column as int using hibernate criteria API?</a></p>
  
  <p>I want to create an order restriction with a cast to int from a string column. Something like</p>
  
  <pre><code>criteria.addOrder(Order.asc("cast(id as int)"));
  </code></pre>
  
  <p>The exception is "Could not resolve property: cast(id as int) of [Class]". I've tried both cast( as ) and convert(,) with int and integer.</p>