Search code examples
databaserdbmserd

Can there be a relationship on the higher level entity in a total specialization?


I have the following scenario where a Product can ONLY be a SaleProduct or a LoanProduct.enter image description here

Is the relationship between Supplier and Product valid? Or should the relationship be between Supplier and SaleProduct and Supplier and LoanProduct individually?

Thanks.


Solution

  • First of all your diagram is not a UML one. I don't recognise this notation at all.

    I'll ignore your diagram and focus on the question itself. Yes, it's perfectly valid to have a relationship on the parent (generic) class and of course it will be inherited by it's children (specialised classes). That's pretty much one of the goals of having those common elements (relationship in this case) on the parent level rather than doubled on the child level.