-->
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: Design issue - unsure of how to map this
PostPosted: Fri May 11, 2007 12:57 pm 
Newbie

Joined: Tue May 08, 2007 11:28 am
Posts: 10
Hibernate version:
3.2

So I have a bit of a design issue that I figured I would throw out here to see if any of you have done something similar. I'm sure you have, it's not a terribly unique problem, I am just having trouble wrapping my head around how it should work.

I am building an application where different customers can have different pricing models, sort of like oem vs retail. Each client will have different negotiated rates. For example if a client buys a unit of merchandise, 0-4 is the regular cost, 5-10 is a fixed cost, and 11-15 is a different cost. So if the product is $1 per unit, up to 5 they would be charged $1 each. After that, 5-10 units are a flat cost of $7 for all(not per unit). They can specify as many different levels as required in the contract. There are some clients who will have this "oem" type account and some that will pay only retail.


So in my database I have a table of definitions and a table of "models" that associate all the definitions together into something I associate to the user account. The problem is, how to associate the collection of definitions into a collection of units for that model. Right now, when I load up this data(there's only 5 unique units), I load it into a map indexed on the unit. The problem is that I can't figure out how to map the collection of charge definitions for that unit into the map.

Perhaps I am just going about this the wrong way. I'm sure someone out there has a better idea so if you think my approach is all wrong, I'd be happy to change the model to get this to work.


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.