In this chapter, we explain two case studies based on fragments of the information model of our running example, the Public Library app. In the first case study, we consider the single-level class hierarchy with root
Book shown in Figure 12.1, which is an incomplete disjoint segmentation. We use the Single Table Inheritance approach for mapping this class hierarchy to a single database table.
In the second case study, we consider the multi-level class hierarchy consisting of the
Author, shown in Figure 12.8. We use the Joined Table Inheritance approach for mapping this class hierarchy to a set of database tables that are related with each other via foreign key dependencies.
In both cases we show
how to derive a Java Entity class model,
how to code the Java Entity class model in the form of Java Entity classes,
how to write the view and controller code based on the model code.