Adding multiple objects with the same attribute in one go

Hi ,  I’ve struggled with a similar problem in the past but I feel like this one is slightly more advanced.  I'd like to add multiple objects under the same attribute in one attempt. In my case: I want to be able to put multiple products under the same order number/order.  Currently I can only add one product for each order. After I save it, the NewEdit page automatically closes and the order pops up on the overview page. I do know about the use of "Save+Next”, but I don't think I can use this for my current problem.  If there are things that still remain unclear, please do ask
2 answers

Could you show us your domain model? The most classic of examples and probably what you’ll also want to do is the Order - Orderline – Product.

You have 1 order object but you have multiple products. So you would want a 1 – * association between Order and Product. But seeing as a Product is basically ‘master data’ and you will want to keep count of the amount of products for this specific Order you’ll want to have another entity inbetween them: Orderline. On this object you can keep count of the amount of products ordered for this specific product under a specific order.

So a 1 – * association between Order and Orderline. because an Order can have multiple different products with different amounts

And a 1 – * association between Product and Orderline. Because an orderline is only for 1 product. But a product can be associated with multiple orderlines.



I was about to direct you to another question, but I see that question was from you, just yesterday. The answers there didn't help you? If so, let us know so we can help you better :)