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

相關文章
相關標籤/搜索