MyBatis 踩坑笔记

2019-04-08  本文已影响0人  阿臻同学

查询一个表中多个元素时,返回的List为空集合

现象

原Mapper中的select代码,Base_Column_ListBaseResultMap分别是包含了要查询的对象中的所有属性的<sql><resultMap>
mapper.xml:

  <select id="selectAll" resultMap="BaseResultMap">
    select <include refid="Base_Column_List" />
    from ContestRegistration
  </select>

接口:

List<ContestRegistration> selectAll();

但是最终返回的list无论如何都是size()=0。

解决

在select语句中,直接

select *
上一篇 下一篇

猜你喜欢

热点阅读