title: JPA ManyToMany, how can JoinTable have a property?
body: <p>I have a question for designing the ManyToMany in EJB, how can a jointable has a property?<br>
  Here is an example, the students and courses are ManyToMany, every student have many courses, and many students choose one course. </p>
  
  <pre><code>    @Entity
      public class Student implements Serializable { 
          @Id
          @GeneratedValue(strategy = GenerationType.AUTO)
          Long id;
          String name;
          private Collection&lt;Course&gt; courses; 
  
          @ManyToMany(mappedBy = "students",cascade=CascadeType.ALL)      
          public Collection&lt;Course&gt; getCourses() {
              return this.courses;
          }
  
          public void setCourses(Collection&lt;Course&gt; courses) {
              this.courses = courses;
          }
  
      }
  
  
      @Entity
      public class Course implements Serializable { 
          @Id
          @GeneratedValue(strategy = GenerationType.AUTO)
          Long id;
          String name; 
          private Collection&lt;Student&gt; students; 
  
          @ManyToMany(cascade=CascadeType.ALL)
          @JoinTable(name = "Student_Course",
          joinColumns = {@JoinColumn(name = "Course_ID", referencedColumnName = "id")}, 
          inverseJoinColumns = {@JoinColumn(name = "Student_ID", referencedColumnName = "id")})  
  
          public Collection&lt;Student&gt; getStudents() {
              return this.students;
          }
  
          public void setStudents(Collection&lt;Student&gt; students) {
              this.students = students;
          }
      }
  </code></pre>
  
  <p>However if I have a property in the JoinTable, for example each student has one score for one course. How can I make it in EJB with ManyToMany?<br>
  Many thanks for your attention!<br></p>