更新时间:2021-11-22 08:56:16
在您的集合中,您可以添加过滤器:
In your set you can add a filter:
<set name="CollegeStudents" table="tstudent_course"
inverse="true">
<key>
<column name="id_course" not-null="true" />
</key>
<many-to-many entity-name="CollegeStudent" where="person_type='COLLEGE_STUDENT'">
<column name="id_person" not-null="true" />
</many-to-many>
</set>
恕我直言,如果没有该过滤器(只有一组学生),映射会更好.
IMHO the mapping would be better without that filter (just a set of all students).