Hello,
I was hoping for a suggestions on how best to tackle this issue.
I am trying to build a simple store. The trouble i am having with is item pricing and availability.
The items availability and pricing is based on the user. There are scenarios that a product might not be available to a guest but is available to a registered user. Also the prices for 2 different registered users or a guest and a registered users might be different. So I can only determine price at run time.
Now in the store i have to display items sorted by price. For a guest it was pretty straight forward, I wrote a sql function and created a formula in hibernate and made it property in the pojo. But for a registered member, I need to supply the function with the member's id.
I do not know how to send runtime parameters to a hibernate formula. So I think my method of dealing with this is flawed.
I looked in filters but that did not really help much.
Does any one have any ideas of how to have the result of a sql function that has a run time parameter as a column that i can sort by?
thanks
S.
|