This question is locked. New answers and comments are not allowed.
Perhaps I'm missing something, but I don't understand why the following happens. I will 'try' to keep it simple.
I have two tables:
Customer
CustomerAddress
In Customer, is a field named BillToAddressID, which contains the ID of the address in the CustomerAddress table.
I perform a reverse mapping against the tables.
Everything works great, except for one thing...
There are other addresses in CustomerAddress, and the user may want to change the Bill To Address to something that already exists in the CustomerAddress table.
However, this is a problem, because apparently, when you have a one to one relationship with a table (or one to many for that matter), the ID field in the Customer Table (in this case BillToAddressID), is not included in the class that is generated.
Can someone tell me why?
I add it back in manually, so when a user wants to change the address, all that needs to be updated is the BillToAddressID in the Customer Table (if it exists in CustomerAddress, of course).
My question is, why does reverse mapping remove the field? I completely understand that you don't need it, if you are creating a new customer, and also creating a new Bill To Address, but you are stuck if you want to change that value to another address that exists in the CustomerAddress table.
Maybe I'm just off my nut, and if I am, can someone please set me straight?
Thanks, Kuba
I have two tables:
Customer
CustomerAddress
In Customer, is a field named BillToAddressID, which contains the ID of the address in the CustomerAddress table.
I perform a reverse mapping against the tables.
Everything works great, except for one thing...
There are other addresses in CustomerAddress, and the user may want to change the Bill To Address to something that already exists in the CustomerAddress table.
However, this is a problem, because apparently, when you have a one to one relationship with a table (or one to many for that matter), the ID field in the Customer Table (in this case BillToAddressID), is not included in the class that is generated.
Can someone tell me why?
I add it back in manually, so when a user wants to change the address, all that needs to be updated is the BillToAddressID in the Customer Table (if it exists in CustomerAddress, of course).
My question is, why does reverse mapping remove the field? I completely understand that you don't need it, if you are creating a new customer, and also creating a new Bill To Address, but you are stuck if you want to change that value to another address that exists in the CustomerAddress table.
Maybe I'm just off my nut, and if I am, can someone please set me straight?
Thanks, Kuba