hi,
i must implement a many-to-many association with an attribute put in the bridge table.
as example, i have one table "Student" and one table "Courses". I wish to model the set of examinations for each students like that:
create table Student(studentId string,....)
create table Course(courseId string,...)
create table StudentExams(studentId not null, courseId not null, vote string)
where (studentId,courseId) is the primary key.
<class name="Student">
<id name="id" column="studentId">
<generator class="native"/>
</id>
<set name="examinations" table="StudentExams">
<key column="studentId"/>
<many-to-many column="courseId"
unique="true"
class="Course"/>
</set>
</class>
<class name="Course">
<id name="id" column="courseId">
<generator class="native"/>
</id>
</class>
my question is: how can I get the "vote" field for each student-course association? Must I create an XML file to map the StudentExam table?
|