Let\'s say I have a persistent class Item with a quantity field and a price field. Is there a way to build a Criteria that calculates the sum of quantity*price?
It is (probably) not possible to do it with Criteria. But HQL can be helpful for this.
SELECT ent.quantity*ent.price from EntityName as ent WHERE ent.id = ?