Hi shand, first of all thanks for your answer.
I want to have multiple notes for one sales order and we need to persist the notes when SalesOrder persists.
You had said me:
Quote:
If you want to allow a SalesOrder to have multiple Notes, your table structure needs to change. You need to put the SalesOrder primary key in the Notes table (and not the other way around). Or you need to define a join table between SalesOrder and Notes.
Consider that we have a complete erp developed using ejb 2.x and we are considering to port it in ejb3.
Obviously I have reported here a very simplified example.
So, in general for us, putting the main table key in the dependent table will have a high cost, in few word:
Notes table is the table in which we store Notes for all entities that manages the Notes. Just like SalesOrder entity,
all other entities that manages Notes has a property (so a db column) named UniquedId that refers to the first
primary key field of Notes table.
That means that we have to change our ERP to have a separate Notes entity (and db table) for all those entities that needs to store Notes.
But you had told me that I can also define a join table between SalesOrder and Notes.
Please could you explain me what do you mean?
A little example will be very appreciated.
Thanks again in advance for your time.