次のクラスがあるとします。
class Student{
String name;
List<StudentClassMark> courseMarks;
}
class Class {
String title;
}
class StudentClassMark {
Student student;
Class class;
MarkType markType; <-- notice this is the extra column that is causing problems
}
class MarkType {
String description;
}
hibernate マッピング ファイルを使用してリストをマップするにはどうすればよいですか (JPA アノテーションはありません)。これが私が試したものです:
<class name="Student" table="PERSON">
<property name="name" column="NAME"/>
<bag name="courseMarks" inverse="false" cascade="all" table="STUDENT_CLASS_MARK">
<key column="STUDENT" />
<many-to-many> <-- this is the section that I don't know how to do
<column name="CLASS"/>
<column name="MARK_TYPE"/>
</many-to-many>
</bag>
</class>
私が見つけた例はすべて、使用できないJPA表記を使用しています。
ありがとう