To me the database seems to be wrong. If a contact can only exist for a single customer, then there shouldnt be a many to many, but a many to one.
So you'd have customer and contacts and a foreign back to customer from the contacts table. Is there addition information oh are capturing in the customercontacts table? On Aug 27, 2011 2:32 PM, "Kris-I" <[email protected]> wrote: > For me it's normal, a Customer can have several Contact and a contact is > link to one Customer. If the mapping it's not correct for you ... tell me > how correct this. > > But I need this : > - A Customer can have several Contact > - When I delete a Customer the Contact must be deleted too. > > Regards, > > On 27 August 2011 18:20, Oskar Berggren <[email protected]> wrote: > >> First you say it's many-to-many. Then you say what when one side is >> deleted, the other should be deleted too, which is weird in >> many-to-many since there could be other references. >> >> In Customer you indeed have a many-to-many mapping, but in Contact you >> have a many-to-one mapping back to Customer. Why? >> And you have the relation table CustomerContact, and yet the Contact >> also has a direct reference to Customer. Why? >> > > -- > You received this message because you are subscribed to the Google Groups "nhusers" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to [email protected]. > For more options, visit this group at http://groups.google.com/group/nhusers?hl=en. > -- You received this message because you are subscribed to the Google Groups "nhusers" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/nhusers?hl=en.
