Embeddable

An Embedded class is a class whose instances are stored as part of an owning entity; it shares the identity of the owning entity. Each field of the embedded class is mapped to the database table associated with the owning entity.

To override the mapping information for a specific subclass, use the @AttributeOverride annotation for that specific class.

An embeddable entity is identified by the @Embeddable annotation.

Use this procedure to add embeddable persistence to an existing entity:

  1. Open the Java class in the Package Explorer.

  2. Select the class in the JPA Structure view.

  3. In the JPA Details view, use the Map As drop-list to select Embeddable.

    Selecting Embeddable Persistence

    Selecting embedded persistence on the JPA Details view.
  4. Complete the remaining JPA Details view (for entities).

 

Related tasks
Adding persistence to a class
Specifying additional tables
Specifying entity inheritance