Specifying additional tables

An entity may inherit properties from other entities. You can specify a specific strategy to use for inheritance.

Use this procedure to specify inheritance (@Inheritance) for an existing entity (@Entity):

  1. Select the entity in the Package Explorer.

  2. In the JPA Details view, select the Secondary Tables information.

    Specifying Secondary Tables

    Secondary Tables area on the JPA Details view.
  3. Click Add to associate an additional table with the entity. The Edit Secondary Table dialog appears

  4. Select the Name, Catalog, and Schema of the additional table to associate with the entity.

Eclipse adds the following annotations the entity:

@SecondaryTable(name="NAME", catalog = "CATALOG", schema = "SCHEMA"


 

Related reference

 

Related task

Adding persistence to a class

 

Related concept

Understanding Java persistence