Let's say I have
List cats = sess.createCriteria(Cat.class) .add( Restrictions.like("name", "F%") .addOrder( Order.asc("name") ) .list(); Lets presume the cat class has 2 more properties, livesUsed and livesTotal.
Is it possible to order ascending the criteria by a query that computes the difference between livesTotal and livesUsed without adding a new column to the db_cats with livesDifference ?
How do I implement that ?