One-to-many mapping

Use a One-to-Many Mapping to define a relationship with one-to-many multiplicity.

  1. In the JPA Structure view, select the field to map.

  2. Right-click the field and then select Map As > One-to-many. The JPA Details view (for attributes) displays the properties for the selected.

    JPA Details, One-to-many Mapping

    JPA Details, One-to-many Mapping
  3. Complete each field in the One-to-Many Mapping area.

  4. Complete the remaining areas in the JPA Details view (for attributes):

Eclipse adds the following annotations to the field:


    fetch = FetchType.<FETCH_TYPE>, 
    mappedBy = "<MAPPED_BY>"
@JoinTable(name="<JOIN_TABLE_NAME>", joinColumns=@JoinColumn(name=

Related tasks

Related references

Related concepts