Вопрос

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