Defining and Removing Relationships between Embeddables and Entities

  1. In the Relations list of Palette, choose a relationship type.

  2. Embed the embeddable in an entity.

    Note:

    To create a bi-directional relationship from embeddable to an entity, the embeddable must be pinned to exactly one entity.

    Also, bear in mind that JPA diagram editor supports only one bidirectional relationship per embeddable.

  3. Click on the embeddable or press ESCAPE to cancel.

  4. Click on the target entity of the relationship or press ESCAPE to cancel.

    The Eclipse IDE creates and visualizes the relationship, as well as the relevant relationship attributes of the entity and the embeddable, depending on the type of relation.

  5. To remove a particular relationship, select the relation on the JPA diagram and press DELETE , or choose Delete from the context menu.

    Removing a relationship via the JPA diagram also removes it from the application data model and deletes the relationship attributes of the related entity and embeddable.