Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version:2.x
I have a distance property on a class that is calculated at runtime. For this i decided to use a derived property formula.
Problem is the formula has one parameter whose value is not available to me until runtime. e.g
<property name="distance" formula="round(sqrt(:newlatitude - latitude))" type="double" />
This newlatitude is something i can only provide at runtime. However I would also like to load my class by id, at which time I would like the distance property to be 0.0.
Due to this I'm having to write a native SQL for this class, whenever I want the distance populated. And in the mapping file I use
<property name="distance" formula="0.0" type="double" />
I know I may be missing something here. Your help is appreciated.
Thanx