An embeddable class can be pinned either to an entity, or to another embeddable.
You can embed a single instance of the embeddable class, or a collection of the embeddable class.
In the Composition list of Palette, choose Embed Single Element.
Click on the source entity or the embeddable of the Has-A relationship or press ESCAPE to cancel.
Click on the target embeddable of the Has-A relationship or press ESCAPE to cancel.
The Eclipse IDE creates and visualizes the Has-A relationship, as well as the relevant embedded attribute in the entity, in which the embeddable is set.
The attribute will be mapped with the @Embedded annotation.
In the Composition list of Palette, choose Embed Collection of Elements.
Click on the source entity or the embeddable of the Has-A relationship or press ESCAPE to cancel.
Click on the target embeddable of the Has-A relationship or press ESCAPE to cancel.
The Eclipse IDE creates and visualizes the Has-A relationship, as well as the relevant embedded attribute in the entity, in which the embeddable is set.
The attribute will be mapped with the @ElementCollection annotation.
To remove a particular Has-A 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 embedded attributes of the embedding entity.