0
假設我有以下類別:休眠:如何映射加入額外列的表沒有JPA註釋
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符號,我不能使用。
謝謝