Mapping Inheritance
You use this procedure to specify inheritance between classes.
You have:
● Created an EJB 3.0 Project
More information:
Creating EJB 3.0
Projects
● Created your entities
More information: Creating Persistent Entities
● Opened the Java Persistence perspective
More information:
Java Persistence
Perspective
...
1. Select the entity in the Package Explorer.
2. Select the entity in the Persistence Outline.
3. On the Persistence Properties view, choose the Inheritance tab.
4. Select an inheritance strategy from the dropdown list:
● Single Table – all classes in the hierarchy are mapped to a single database table.
● Joined – the root class is mapped to a table, and all other classes are mapped to another table.
The Table per Class strategy is not supported on the SAP NetWeaver Application Server.
5. If you choose single or joined strategy, you must also complete the following fields:
● Discriminator Column: the column in the database table that holds values for identifying the specific subclass to which the instance represented by the table row belongs.
● Discriminator Type: the type of object to use as class discriminator. Possible values are String, Char, and Integer.
● Discriminator Value: specifies the value of the discriminator column for entities of the given type.