Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 916355
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T18:02:19+00:00 2026-05-15T18:02:19+00:00

I’m working on an ERP application where multiple inventories need to be dynamically supported,

  • 0

I’m working on an ERP application where multiple inventories need to be dynamically supported, ie. each depot/branch needs a separate stock value for each product. One approach – avoiding using static table columns – is to have a separate Stock table as follows:

[Product]
Code
...

[Branch]
Code
...

[Stock]
ProductCode
BranchCode
StockValue
...

This effectively becomes a many-to-many relationship separated by the Stock table. Immediately there appears to be pitfalls in this approach, for instance:

  • If there are 5 branches (depots), and 50k product lines, then there will be 5*50k Stock lines. Is this excessive?
  • Each time a Product is added, 5 new Stock lines need to be added – one for each Branch.
  • Each time a Branch is added, 50k new Stock lines need to be added.

The main rationale behind this is to avoid using static columns (which may lead to modifying the mapping files as new Branches are added). So it is supposed to be more dynamic.

Has anyone worked with a similar concept in the past and may perhaps have a more efficient solution? Or if this appears to be a suitable solution, then what NHibernate association method may be most effective?

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T18:02:20+00:00Added an answer on May 15, 2026 at 6:02 pm

    I would create a separate entity — Warehouse and Stores are common names — as a container for stock. Then create a many-to-many relationship between a Branch and the Warehouses they can access Stock from. This gives you the flexibility to have stock stored at the branch and another location (rented space) or allow multiple branches to pull stock from multiple warehouses. Robust ERP systems further classify stock locations into shelf and position, for example.

    Unless every product is stocked at every branch then I don’t see that your list of potential pitfalls are valid. Using the Warehouse model, Stock is a record in a many-to-many table containing the number of items in stock at a warehouse. If the record does not exist than there are none at that location.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.