1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| <!-- type:对象类型 orm --> <resultMap type="dept" id="deptMap"> <!-- 主键字段映射 --> <id column="deptno" property="deptno"/> <!-- 非主键字段映射 --> <result column="dname" property="dname"/> <result column="loc" property="loc"/> <!-- 封装结果到集合 property:属性 javaType:每个对象类型 --> <collection property="emps" ofType="emp" column="deptno"> <id column="empno" property="empno"/> <result column="ename" property="ename"/> <result column="job" property="job"/> <result column="hiredate" property="hiredate"/> <result column="mgr" property="mgr"/> <result column="sal" property="sal"/> <result column="comm" property="comm"/> <result column="deptno" property="deptno"/> </collection> </resultMap>
|