org.apache.ibatis.executor.ExecutorException: A query was run and no Result Maps were found 解决方法

素颜马尾好姑娘i 2024-03-04 07:36 182阅读 0赞

报错:org.apache.ibatis.executor.ExecutorException: A query was run and no Result Maps were found for the Mapped Statement ‘xxx’. It’s likely that neither a Result Type nor a Result Map was specified.

" class="reference-link">bd0aa879e0584c81bcebfe423b821bfb.png

原因:这是因为使用到的sql查询语句没有返回一般数据类型的值,如下

" class="reference-link">064c7c0a0c544ed48b0f98b363e3b7f1.png

修改后:加入返回类型 resultType=”java.lang.Long”,如下

" class="reference-link">fdc4b87ed33343f08d7441de771f24c5.png

这样问题就解决啦

发表评论

表情:
评论列表 (有 0 条评论,182人围观)

还没有评论,来说两句吧...

相关阅读