I have the following connection in my database
(Example)
Table 1: Car {id, name}
Table 1: CarPart {id, name, CarId}
Table 1: CarPartDealer {id, name, CarId, CarPartId}
Step 1. I have define cascade on the relation between car and car part so that when a car is deleted all the car parts are also deleted.
Step 2. I have define cascade on the relation between car and CarPartDealer so that when a car is deleted all the dealers are also deleted.
Step 3. I have define cascade on the relation between CarPart and CarPartDealer so that when a CarPart is deleted all the dealers are also deleted.
So now I am left with multiple cascade paths. When a car is deleted - its car parts are deleted, its car parts dealers, and again its car parts dealers.
But this is the behaviour I want.
How do I create the two cascade path?
Thanks.