-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Adding a derived property from sql expression to criteria
PostPosted: Wed Aug 13, 2008 4:31 pm 
Newbie

Joined: Wed Aug 13, 2008 4:14 pm
Posts: 1
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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.