1、mybatis中mapper xml文件里面要关联其它表的对象
语法:
<association property="dept" column="deptId" select="com.bi.dao.sys.DeptDao.getDeptById"> </association>
有时候会报错:
元素类型为 “resultMap” 的内容必须匹配
“(constructor?,id*,result*,association*,collection*,discriminator?)”
原因:注意 “必须匹配” 四个字, 其意味着顺序很重要, 必须要一致,
试试将 resultMap 中各元素的顺序修改为和错误信息中属性出现的顺序( constructor , id result association …..)一致看看;