たとえば、データベースに次のテーブルがあり、学生とコースに多対多の関係があるとします。
Student
-------
Id (Primary Key)
FirstName
LastName
Course
------
Id (Primary Key)
Title
StudentCourse
-------------
StudentId (Foreign Key -> Student)
CourseId (Foreign Key -> Course)
私のモデルが次のようになっている場合
public class Student
{
private int ID;
private String firstName;
private String lastName;
//getter and setter
}
と
public class Course
{
private int ID;
pirvate String title;
//getter and setter
}
したがって、私の質問は、これら 2 つの Bean のみを作成すると、どのような問題が発生するのでしょうか?どのような問題に直面し、どのような状態になるのでしょうか?そして、そのような多対多の関係の正しい Bean 構造を指定してください。