查询一个表中多个元素时,返回的List为空集合
现象
原Mapper中的select代码,Base_Column_List
和BaseResultMap
分别是包含了要查询的对象中的所有属性的<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 *
网友评论