Result Maps collection does not contain value for xxxx

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

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

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

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

细节方面还是需要注意的

posted @ 2018-09-10 00:35  测试5454  阅读(198)  评论(0编辑  收藏  举报