Many-to-many unidirectional, join table empty after persist

I have got a many-to-many relationship between entities instructor and student. The student is saved and persisted first. Then I create a new instructor and try to add the student to the studentList in instructor. Then I save (persist) the instructor. The instructor is persisted but the jointable is empty. Any ideas?

@Table(name = "instructor")
@PersistenceContext(unitName = "processEntities")
public class Instructor extends Person {

  private static final long serialVersionUID = 1L;

        name = "instructor_student", joinColumns = @JoinColumn(name = "instructor_id"), 
        inverseJoinColumns = @JoinColumn(name = "student_id")
  private List<Student> students = new ArrayList<Student>();

 public List<Student> getStudents() {
    return students;

 public void setStudents(List<Student> students) {
    this.students = students;

@Table(name = "thesisfirstinstructor")
@PersistenceContext(unitName = "processEntities")
public class ThesisFirstInstructor extends Instructor {}

@Table(name = "student")
@PersistenceContext(unitName = "processEntities")
public class Student extends Person {

  private static final long serialVersionUID = 1L;

 private String matrNo;

 public String getMatrNo() {
    return matrNo;

 public void setMatrNo(String matrNo) {
    this.matrNo = matrNo;
 } (EJB)

Student currentStudent= studentDAO.findByThmUid(currentStudentThmUid);

ThesisFirstInstructor thesisFirstInstructor = new ThesisFirstInstructor();



Unfortunately, the join table is empty![grafik|261x170]:


Entity thesisFirstInstructor is persisted.
Any ideas?

Is the instructor properly persisted? I don’t know what your DAO is doing, but you might have to call EntityManager.flush after persisting it.