Hi every one, I have these two class(table)
@Entity
@Table(name = "course")
public class Course {
@Id
@Column(name = "courseid")
private String courseId;
@Column(name = "coursename")
private String courseName;
@Column(name = "vahed")
private int vahed;
@Column(name = "coursedep")
private int dep;
@ManyToMany(fetch = FetchType.LAZY)
@JoinTable(name = "student_course", joinColumns = @JoinColumn(name = "course_id"), inverseJoinColumns = @JoinColumn(name = "student_id"))
private Set<Student> student = new HashSet<Student>();
//Some setter and getter
and this one:
@Entity
@Table(name = "student")
public class Student {
@Id
@Column(name="studid")
private String stId;
@Column(nullable = false, name="studname")
private String studName;
@Column(name="stmajor")
private String stMajor;
@Column(name="stlevel", length=3)
private String stLevel;
@Column(name="stdep")
private int stdep;
@ManyToMany(fetch = FetchType.LAZY)
@JoinTable(name = "student_course"
,joinColumns = @JoinColumn(name = "student_id")
,inverseJoinColumns = @JoinColumn(name = "course_id")
)
private Set<Course> course = new HashSet<Course>();
//Some setter and getter
and after run this code an extra table was created in database(student_course) now I wanna know how can I add extra field in this table like (Grade, Date , and ... (I mean student_course table)) I see some solution butdun like them and Also I have promlem with them: