HiberObjects

Download

Forum

Vote for this plugin
at Eclipse Plugin Central

Design Annotations

Design Annotations

You can override the default generated annotations by designing tags on classes, attributes and associations. The figure below shows the most important annotations on classes and attributes.

Associations will automatically get annotations @OneToOne, @OneToMany, @ManyToOne or @ManyToMany. mappedBy will be generated for bidirectional assocations and optional=false for multiplicity 1.

@Embedded is generated for composites.

Other annotations can be designed as follows:

To design a different id than the default Long id with @GeneratedValue, right click on a class symbol and select Show Id. Then, you can edit the name and type of the id and design annotations.

The following annotations are not supported yet: @IdClass, @EntityListeners, @OrderBy, @MapKey.

Reference

A full reference of JPA annotations can be found at Oracle.