I have these two class(table)
@Entity @Table(name = \"course\") public class Course { @Id @Column(name = \"courseid\") private String courseId;
Drop the many-to-many, create a class called StudentCourseRelationship and set up one to manys on Student and Course to the StudentCourseRelationship.
You can put all sorts of things on it, like DateEnrolled, DateKickedOut etc. etc.
IMO the many-to-many mapping is a bit of a con.