What is the best approach to design a data model based on a generalization relationship. For example imagine there is a based class A and two derived class B and C that inherit class A. Now I want design data model. I have three choices

1) Create Table A and having a type column for specifying B and C data.

2) Create Table A, B and C Just like my class diagram and relate B and C to A.

3) Create Table A, B and C but don't relate B and C to A.

Any clue would be appreciated

有帮助吗?

解决方案

Check out this article. Although it is written for JPA, it tells you the pros and cons of each of the strategies you mentioned.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top