栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Java

mybatis: A query was run and no Result Maps were found for the Mapped Statement .......

Java 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

mybatis: A query was run and no Result Maps were found for the Mapped Statement .......

### Cause: org.apache.ibatis.executor.ExecutorException: A query was run and no Result Maps were found for the Mapped Statement 'com.mypro.mapper.bossMapper.queryBywkid'.  It's likely that neither a Result Type nor a Result Map was specified.
	at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:30)
	at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:153)
	at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:145)
	at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:140)
	at org.apache.ibatis.session.defaults.DefaultSqlSession.selectOne(DefaultSqlSession.java:76)
	at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:87)
	at org.apache.ibatis.binding.MapperProxy$PlainMethodInvoker.invoke(MapperProxy.java:145)
	at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:86)

这是昨天错的问题,但是今天才解决,原因是想改MySQL默认存储路径的时候把mybatis搞的用不了了,弄了好久才搞好。

说下这个问题吧,出现这个问题是因为我在这个resultMap中的collection中调用了另一个bossMapper中的方法,起初我根据报错的信息去搜索原因,得到的结果是说:

select中没有设置resultmap或者resulttype,然后我找的是workermapper中的queryBybsid方法,然后发现那个方法中我加了resultmap,没有出现少的情况。然后我还检查了workermapper中的其他几个方法,发现也没问题,直到我今天仔细看,才发现我应该要注意的是bossmapper中的

queryBywkid这个方法。。。。。。    六个点已经不能表达我的无语了

 这个是缺少了resultmap的方法。大家写代码的时候一定要细心!!!

 

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/856569.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号