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

转自:https://blog.csdn.net/u013399093/article/details/53087469

今天编辑mybatis的xml文件,出现如下错误:
程序出现异常[A query was run and no Result Maps were found for the Mapped Statement  '***'.  It's likely that neither a Result Type nor a Result Map was specified.
at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:) ~[mybatis-spring-1.2..jar:1.2.]
at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:) ~[mybatis-spring-1.2..jar:1.2.]
at com.sun.proxy.$Proxy54.selectList(Unknown Source) ~[?:?]
at org.mybatis.spring.SqlSessionTemplate.selectList(SqlSessionTemplate.java:) ~[mybatis-spring-1.2..jar:1.2.]………………

仔细查看mybatis的配置文件,发现遗漏一个属性:resultType

报错的配置是:<select id="ID"  parameterType="java.util.Map">
正确的配置应该是<select id="ID" parameterType="java.util.Map" resultType="java.util.Map">

上一篇:openstack私有云布署实践【17 配置文件部份说明】


下一篇:Python爬取谷歌街景图片