186VisualAge for JavaVersion 3: PersistenceBuilder with GUIs, Servlets, and JSPs
Figure 119.BankAccount with Inheritance:Checking and Savings
Thereare twoways to match an inheritance tree to arelational database:
either all ofthe attributes ofthe class hierarchyare combined in onetable
(single table inheritance mapping) or a tableis used for eachclass and the
necessary foreignkey relationships between the tables aredefined(multiple
tableinheritance mapping).
Single TableInheritance Mapping
Mapping the BankAccount class and its subclasses into one table means that
we put all attributes, whether from theBankAccount class or from an ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month, and much more.