-->
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: hibernate formula with run time parameters
PostPosted: Fri Aug 20, 2010 2:03 pm 
Newbie

Joined: Thu Jan 29, 2009 8:49 pm
Posts: 5
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.


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.