mybatis报Could not find result map java.lang.Integer之类的错误
来源:互联网 发布:linux 社区 编辑:程序博客网 时间:2024/06/06 09:14
在测试的时候报告:org.apache.ibatis.builder.IncompleteElementException: Could not find result map java.lang.Integer
我检查了对应的mapper文件和接口文件都没有发现问题。运行任何一个和mybatis相关的测试,发现全部都报告这个错误。
我猜想是mybatis的配置文件出错了,检查后发现没有问题。
把所有的mapper文件搜了一遍,发现一个文件中有
<!--检测权限是否被授权--> <select id="checkObjectList" resultMap="java.lang.Integer"> SELECT a.OBJECT_ID FROM SYS_ROLE_AUTHORITY AS a LEFT JOIN SYS_ROLE_AUTHORITY_RELATION AS b ON a.`AUTHORITY_ID`= b.`AUTHORITY_ID` WHERE a.`TYPE`=#{type} AND b.`ROLE_ID`=#{roleId} AND b.`AUTHORITY_TYPE`=0 AND a.`OBJECT_ID` IN( <foreach collection="objectIds" item="item" index="index" separator="," > #{item} </foreach> ) </select>
把上面的resultMap改为resultType,发现所有的测试全部都通过了。看来一个mapper文件的resultType、resultMap错误会影响其他的mapper文件。
改成:
<!--检测权限是否被授权--> <select id="checkObjectList" resultType="java.lang.Integer"> SELECT a.OBJECT_ID FROM SYS_ROLE_AUTHORITY AS a LEFT JOIN SYS_ROLE_AUTHORITY_RELATION AS b ON a.`AUTHORITY_ID`= b.`AUTHORITY_ID` WHERE a.`TYPE`=#{type} AND b.`ROLE_ID`=#{roleId} AND b.`AUTHORITY_TYPE`=0 AND a.`OBJECT_ID` IN( <foreach collection="objectIds" item="item" index="index" separator="," > #{item} </foreach> ) </select>
错误解决了。
阅读全文
0 0
- mybatis报Could not find result map java.lang.Integer之类的错误
- mybatis报Could not find result map java.lang.String
- Mybatis——Invalid bound statement (not found)-Could not find result map java.lang.Integer
- Could not find result map java.lang.Integer
- iBatis: Could not find result map java.lang.Integer
- mybatis IncompleteElementException:Could not find result map java.lang.String
- mybatis IncompleteElementException:Could not find result map java.lang.String
- mybatis异常:Could not find result map java.lang.String
- MyBatis项目查询数据库Could not find result map java.lang.String
- IncompleteElementException: Could not find result map java.lang.Long
- Could not find result map java.lang.String异常
- Could not find result map 错误
- mybatis异常:Could not find result map java.util.Map 问题分析及解决
- Could not find result map
- Mybatis Could not find result map XXXX int
- org.apache.ibatis.builder.IncompleteElementException: Could not find result map java.lang.String
- IncompleteElementException:Could not find result map java.util.Map异常
- myibatis 报错 Could not find result map java.util.HashMap
- WebView 生成长图,截图
- 【js初学】9*9乘法表,javascript
- Spring5:@Autowired注解、@Resource注解和@Service注解
- jvm视角看java继承和多态
- 抽屉布局+Fragment+TabLayout上导航栏+PullToRefreshListView+轮播图+PullToRefreshGridView
- mybatis报Could not find result map java.lang.Integer之类的错误
- JavaScript Dom 编程艺术学习笔记之DOM操作
- 【第四周项目1】 建立单链表
- 第四周项目1
- Centos7的Docker容器里部署xwiki
- Xamarin.Forms XAML的辅助功能Code Snippet
- 实现分页功能
- tensowflow报错tensorflow.python.framework.errors_impl.InvalidArgumentError<exception str
- MySQL数据库(三)_视图_虚表