title: ORDER BY "CASE column" in JPA
body: <p>I want to ORDER BY the case statement, is it possible? How can I do it?</p>
  
  <pre><code>SELECT new com.systemname.to.UserDataHolder(u.userId, 
  CASE  WHEN (u.place.cityId = :cityId) THEN 1  WHEN (u.place.stateId = :stateId) THEN 2  ELSE 3 END)  
  FROM User u 
  ORDER BY u.userId DESC 
  </code></pre>