无法转换出错,原因是类与表名相互映射的映射文件中出错,其中的many-to-one属性,class类名错误
<!-- 用户与部门多对一关系 -->
原先出错的配置:
<many-to-one name="department" class="com.lnx.oa.domain.User" column="departmentId"></many-to-one>
修改后的正确配置:
<many-to-one name="department" class="com.lnx.oa.domain.Department" column="departmentId"></many-to-one>
删除出错的原因,多对一需要添加级联删除属性delete,修改后的正确配置是:
<!-- 用户与部门多对一关系 -->
<many-to-one name="department" class="com.lnx.oa.domain.Department" cascade="delete" column="departmentId"></many-to-one>