One table for the whole hierarchy

If you choose this option, you will create one physical database table to store all types in the hierarchy. The single table, in this example Animal will store all attributes required by any type, with default/null values stored where not applicable to a particular type.

This option requires a disciminator value in the form of the attribute Animal.animalType. This attribute stores a String value which will allow the implementation to determine whether a particular Animal is a Cat or a Dog.

You must provide the following implementation classes (listed in dependency order):

These classes are described in detail below. The concrete (Cat and Dog) implementation classes are reasonably straightforward, but the abstract (Animal) classes are more complex.