1,设置数据库一方关系选中 “级联删除相关选项”
2,
<set name="jobses" inverse="true" cascade="all">
<key>
<column name="classify_id" not-null="true" />
</key>
<one-to-many class="com.osic.project.security.model.Jobs" />
</set>
<many-to-one name="classify" class="com.osic.project.security.model.Classify" fetch="select"
lazy="false">
<column name="classify_id" not-null="true" />
</many-to-one>