码迷,mamicode.com
首页 > 移动开发 > 详细

Error querying database. Cause: org.apache.ibatis.builder.IncompleteElementException: Could not find parameter map com.lxh.mybatis.mapper.UserMapper.int

时间:2020-06-12 20:38:20      阅读:80      评论:0      收藏:0      [点我收藏+]

标签:base   tab   sele   test   set   ras   原因   not   exce   

1.报错信息:

org.apache.ibatis.exceptions.PersistenceException:
### Error querying database. Cause: org.apache.ibatis.builder.IncompleteElementException: Could not find parameter map com.lxh.mybatis.mapper.UserMapper.int
### Cause: org.apache.ibatis.builder.IncompleteElementException: Could not find parameter map com.lxh.mybatis.mapper.UserMapper.int
at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:26)
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:111)
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:102)
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectOne(DefaultSqlSession.java:66)
at com.lxh.mybatis.test.MybatisTest.main(MybatisTest.java:44)
Caused by: org.apache.ibatis.builder.IncompleteElementException: Could not find parameter map com.lxh.mybatis.mapper.UserMapper.int
at org.apache.ibatis.builder.MapperBuilderAssistant.setStatementParameterMap(MapperBuilderAssistant.java:319)
at org.apache.ibatis.builder.MapperBuilderAssistant.addMappedStatement(MapperBuilderAssistant.java:283)
at org.apache.ibatis.builder.xml.XMLStatementBuilder.parseStatementNode(XMLStatementBuilder.java:107)
at org.apache.ibatis.session.Configuration.buildAllStatements(Configuration.java:698)
at org.apache.ibatis.session.Configuration.getMappedStatement(Configuration.java:629)
at org.apache.ibatis.session.Configuration.getMappedStatement(Configuration.java:624)
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:107)
... 3 more
Caused by: java.lang.IllegalArgumentException: Parameter Maps collection does not contain value for com.lxh.mybatis.mapper.UserMapper.int
at org.apache.ibatis.session.Configuration$StrictMap.get(Configuration.java:797)
at org.apache.ibatis.session.Configuration.getParameterMap(Configuration.java:570)
at org.apache.ibatis.builder.MapperBuilderAssistant.setStatementParameterMap(MapperBuilderAssistant.java:317)
... 9 more

2.原因:没留意自动补齐,属性名应为paramType

技术图片

 

3.解决:把属性名修改过来就好了

 

Error querying database. Cause: org.apache.ibatis.builder.IncompleteElementException: Could not find parameter map com.lxh.mybatis.mapper.UserMapper.int

标签:base   tab   sele   test   set   ras   原因   not   exce   

原文地址:https://www.cnblogs.com/lxhK/p/13109605.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!