I have two classes Parent
and Child
.
class Child extends Parent {
private String extraField1;
private String extraField2;
...
}
Child
class has 2 extra fields extraField1
and extraField2
.
Q1. Should I make two diff. tables in the databse: one for Child
and other for Parent
?
or
Q1. Should I add two columns in the Parent
table (each column for one extra field) and store the Child
in the Parent
table.
=============================== EDITED =======================================
Yes, Child
and Parent
are classes in the same hierarchy.