-->
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.  [ 2 posts ] 
Author Message
 Post subject: Best Place to calculate inventory available?
PostPosted: Tue Sep 21, 2004 3:05 pm 
Beginner
Beginner

Joined: Wed May 12, 2004 2:52 pm
Posts: 36
All,

I am putting together a simple shopping cart application. As a business requirement, customers cannot order more products than are currently in stock (No Back Ordering).

This application has an Order object which contains LineItem objects. Each line item references a Product. Each of these objects has its own underlying table. The "Product" table contains product information as well as the products quantity. The LineItem object/table contains the quantity of the product that gets ordered by the customer.

Where/when should the remaining inventory get calculated? If I use hibernate, it sounds like I would have to retrieve all of the lineItems for a particular product and sum up the ordered quantities in each lineItem and subtract this number from the products quantity to determine the number available. Does this sound right? Is there a better way to do this?

Regards,

Joshua


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 21, 2004 6:39 pm 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
just use a HQL query?


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

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.