<resultMap id="UserWithDept" class="TUser">
<result property="UID" column="U_ID" dbType="Int"/>
<result property="UName" column="U_Name" dbType="VarChar"/>
<association property="Dept" class="Dept">
<id property="DID" column="DID"/>
<result property="Dept_Name" column="Dept_Name"/>
</association>
</resultMap>
</resultMaps>
<!-- 查询带功能的用户-->
<select id="FindUserWithDeptByID" resultMap="UserWithDept"><!---->
SELECT U_ID,U_Name,T_USER.DID DID,Detp_NAME
FROM T_USER,T_DEPT
WHERE
T_USER.DID=T_DEPT.DID AND
(U_ID=#UID#)
</select>
这样写完,返回的user 对象为什么DEPT属性为空啊?