title: Can a JPA entity have multiple OneToMany associations?
body: <p>Adding two <code>OneToMany</code> associations to my entity class seems not to work. It works fine if I remove one of them.</p>
  
  <pre><code>@Entity
  @Table(name = "school")
  public class School {
  
      private List&lt;Teacher&gt; teachers;
      private List&lt;Student&gt; students;
  
      @OneToMany(cascade=CascadeType.ALL, mappedBy = "school", fetch = FetchType.EAGER)
      public List&lt;Teacher&gt; getTeachers()
          return this.teachers;
      }
      public void setTeachers(List&lt;Teacher&gt; teachers) {
           this.teachers = teachers;
      }
  
      @OneToMany(cascade=CascadeType.ALL, mappedBy = "school", fetch = FetchType.EAGER)
      public List&lt;Student&gt; getStudents()
          return this.students;
      }
      public void setStudents(List&lt;Student&gt; teachers) {
           this.students = students;
      }
  }
  </code></pre>
  
  <p>Then in <code>Teacher</code> and <code>Student</code> I have the correct <code>ManyToOne</code> annotations</p>
  
  <pre><code>@Entity
  @Table(name = "teacher")
  public class Teacher {
      private School school;
  
      @ManyToOne
      @JoinColumn(name = "school_id")
      public School getSchool() {
          return this.school;
      }
      public void setSchool(School school) {
          this.school = school;
      }
  }
  
  @Entity
  @Table(name = "student")
  public class Student {
      private School school;
  
      @ManyToOne
      @JoinColumn(name = "school_id")
      public School getSchool() {
          return this.school;
      }
      public void setSchool(School school) {
          this.school = school;
      }
  }
  </code></pre>
  
  <p>I also have <code>id</code> fields with the correct annotations (<code>@Id</code>, <code>@GeneratedValue</code>)</p>
  
  <p>So to me it seems like I cannot have more than one <code>@OneToMany</code> in the same class. Is this correct?</p>