Result Maps collection does not contain value for xxxx

这是mybatis查询返回值的错误,我在作一个查询数值的方法,可是我是这样写的:mybatis

    <select id="findSize" resultMap="long">
        select count(1) from advertisement
    </select>
<!-- 注意是resultMap -->

其实若是是返回数值的话,就不该该写resultMap,而是resultType,看下面的代码:spa

    <select id="findSize" resultType="long">
        select count(1) from advertisement
    </select>

细节方面仍是须要注意的code

相关文章
相关标签/搜索