为类起别名,如果觉得 EmployeeMapper.xml,resultType写全类名过长的话: 但是推荐写全类名
<mapper
namespace=
"com.stayreal.mybatis.EmployeeMapper">
<
select id=
"getEmpById" resultType=
"com.stayreal.mybatis.Employee">
select *
from tbl_employee
where id =
#{id}
</
select>
<mapper>
三种方式
mybatis-config.xml
<typeAliases>
<package name="com.stayreal.mybatis"/>
</typeAliases>
转载请注明原文地址: https://www.6miu.com/read-35534.html