How to use order by clause for sort by sum of field
Entity:
class MyClass {
private int a;
private int b;
//...
}
HQL works correctly:
"SELECT myclass FROM MyClass myclass ORDER BY myclass.a + myclass.b DESC "
How to do the same thing using Criteria API?