19、Mybatis进阶:映射文件_select_返回List

本文内容来自上硅谷

如果dao如下

public List<Employee> getEmpsByLastNameLike(String lastName);

则xml配置如下

<!--resultType:如果返回的是一个集合,要写集合中元素的类型  -->
<select id="getEmpsByLastNameLike" resultType="com.atguigu.mybatis.bean.Employee">
   select * from tbl_employee where last_name like #{lastName}
</select>

版权声明:本文不是「本站」原创文章,版权归原作者所有 | 原文地址: