假设我有以下课程:
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;
}
如何使用休眠映射文件映射列表(所以没有 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 表示法。
谢谢