In my object model class there is a derived calculation, daysPassed (which is not a property in the model), which is calculated by taking a property already in the model (orderDate). I have a function that gets a list of those model objects based on certain parameters, and now I also want to add the ability to sort on the derived property daysPassed. I know how to do it in sql - select sysdate-table.orderDate, table.* from table, but I am unable to convert that to use Criteria in Hibernate. Any help is greatly appreciated.
|