A single table inheritance map is used to map two or more persistent model classes to the same table. This is useful for persistent objects that have basically the same data but different behaviors. An example of this type of mapping is included with the Bank sample model.
Launch the Map Browser, and select BankSample from the Datastore Maps view, and then select VapAccount from the Persistent Classes view.
Note that VapAccount has two subclasses: VapCheckingAccount and VapSavingsAccount. All three of these classes map to the ACCOUNT table.
It was created as follows:
The single table inheritance mapping is now defined.
For a model that has inheritance, when a new schema is generated a single table inheritance approach is used. However, the table maps for the primary table is created once but added twice to each class map. To correct this, select one of the table maps and select the option in the browser to delete it.