One table per class

If you choose this option, you will create one physical database table per class (whether abstract or concrete) in your hierarchy.

This option makes use of 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 without further reads. This data is denormalized (it can be determined by attempting to read rows on the Cat and Dog tables and seeing which one succeeds), however processing is greatly simplified and performance increase by the use of a discriminator.

This option also assumes that all the tables in the hierarchy share the same key value (animalID). It is possible (though very unwieldy) to allow different key values on the tables; for this example assume that the primary key value of an abstract Animal row is the same as its corresponding concrete Cat or Dog row.

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.