Hibernate的set排序
在对应的hbm.xml文件中所需要修改的set标签加上order-by属性即可~
eg.
<set name="courses" inverse="true" order-by="weekday asc, period asc, roomId asc">
<key>
<column name="classID" not-null="true" unique="true" />
</key>
<one-to-many class="org.banana.mms.model.Course" />
</set>
<key>
<column name="classID" not-null="true" unique="true" />
</key>
<one-to-many class="org.banana.mms.model.Course" />
</set>
当然,order-by里用的是中间表的字段~