方案一:
方法二:使用ResultMap標籤解決
<!-- 使用ResulstMap -->
<select id="seeAll" resultMap="ResultMap">
select * from Employee
</select>
<resultMap type="Employee" id="ResultMap">
<!-- id標籤定義主鍵(標識列) -->
<id property="eid" column="id" />
<!-- result標籤定義除了標識列外的其他字段 -->
<result property="ename" column="name" />
<result property="saddr" column="addr" />
</resultMap>