为什么我修改点保存时 员工中的部门变成null了
我也是修改之后数据不变
部门映射文件一对多配置中加入inverse=“true”
<hibernate-mapping>
<class name="com.muke.employee.domain.Department" table="department">
<id name="did" column="did">
<generator class="native"></generator>
</id>
<property name="dname" length="20"></property>
<property name="ddesc" length="100"></property>
<!-- 一对多 -->
<set name="employees" cascade="delete" inverse="true">
<key column="dno"/>
<one-to-many class="com.muke.employee.domain.Employee"></one-to-many>
</set>
</class>
</hibernate-mapping>