title: JPA OneToMany MappedBy relationships
body: <p>I have three classes, Site, GoupIP and IP</p>
  
  <p>A Site has one or many GrouIPs.
  A GroupIP has one or many IPs. </p>
  
  <p>Here is the code:</p>
  
  <p><strong>Site</strong></p>
  
  <pre><code>@Entity
  @Table(name = "site")
  public class Site implements Serializable {
  private Set&lt;GroupIp&gt; groups;
  
  @OneToMany(mappedBy = "site", fetch = FetchType.EAGER, cascade =CascadeType.ALL)
  public Set&lt;GroupIp&gt; getGroups() {
      return groups;
  }
  
  public void setGroups(Set&lt;GroupIp&gt; groups) {
      this.groups = groups;
  }
  
  }
  </code></pre>
  
  <p><strong>GroupIP</strong></p>
  
  <pre><code>@Entity
  @Table(name = "groupip")
  public class GroupIp implements Serializable {
  private Set&lt;Ip&gt; ips;
  private Site site;
  
  @ManyToOne(cascade = CascadeType.MERGE)
  @JoinColumn(name = "site_id")
  public Site getSite() {
  return site;
  }
  
  @OneToMany(mappedBy = "groupip", fetch = FetchType.EAGER, cascade =CascadeType.ALL)
  public Set&lt;Ip&gt; getIps() {
      return ips;
  }
  
  public void setIps(Set&lt;Ip&gt; ips) {
      this.ips= ips;
  }
  
  }
  </code></pre>
  
  <p><strong>IP</strong></p>
  
  <pre><code>@Entity
  @Table(name = "ip")
  public class Ip implements Serializable {
  private GroupIp groupIp;
  
  @ManyToOne(targetEntity = GroupIp.class,cascade = CascadeType.MERGE)
  @JoinColumn(name = "groupip_id", nullable=false)
  public GroupIp getGroupIp() {
  return groupIp;
  }
  
  public void setGroupIp(GroupIp groupIp) {
          this.groupIp = groupIp;
  }
  
  }
  </code></pre>
  
  <p>On GroupIp class, I m getting:</p>
  
  <p><em>In attribute 'ips', the "mapped by" value 'groupip' cannot be resolved to an attribute on the target entity.</em></p>
  
  <p>Whats wrong on my code ??</p>