For example if i have following tables in my database and Student and Course has many to many relationship.
Student
-------
Id (Primary Key)
FirstName
LastName
Course
------
Id (Primary Key)
Title
StudentCourse
-------------
StudentId (Foreign Key -> Student)
CourseId (Foreign Key -> Course)
Now if my model is as follows
public class Student
{
private int ID;
private String firstName;
private String lastName;
//getter and setter
}
and
public class Course
{
private int ID;
pirvate String title;
//getter and setter
}
So my question is if i create only these two beans what sort of problem will i encounter?What sort of problem will i face and in which condition?And please specify the correct bean structure for such many to many relationship.