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.shadow.foretaste.UserInfoDao.getPhoneNum‘.  It‘s likely that neither a Result Type nor a Result Map was specified.

导致这个错误的原因是:

mapper.xml中没有指定返回值类型

<select id="getPhoneNum" >
        select phone_num from user_info where id = #{id}
</select>

修改后:

<select id="getPhoneNum" resultType="String">
        select phone_num  from user_info where id = #{id}
</select>
时间: 2024-10-15 04:22:10

A query was run and no Result Maps were found for the Mapped Statement的相关文章

A query was run and no Result Maps were found for the Mapped Statement &#39;user.insertUser!selectKey&#39;. It&#39;s likely that neither a Result Type nor a Result Map was specified.

使用mybatis时出现异常问题: 有如下的错误 1 Error querying database. Cause: org.apache.ibatis.executor.ExecutorException: A query was run and no Result Maps were found for the Mapped Statement 'user.insertUser!selectKey'. It's likely that neither a Result Type nor a

ExecutorException: A query was run and no Result Maps were found for the Mapped Statement ‘com.win.mall.dao.CartMapper.test’. It’s likely that neither a Result Type nor a Result Map was specified.

ExecutorException: A query was run and no Result Maps were found for the Mapped Statement 'com.win.mall.dao.CartMapper.test'. It's likely that neither a Result Type nor a Result Map was specified. 原因:mybatis没有resultMap报错 在mapper文件的 select 标签中没有指定 res

出错:Cause: org.apache.ibatis.executor.ExecutorException: A query was run and no Result Maps were found for the Mapped Statement &#39;cn.mgy.mapper.UserMapper.findById&#39;.

详细出错代码: org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause: org.apache.ibatis.executor.ExecutorException: A query was run and no Result Maps were found for the Mapped Statement 'cn.mgy.mapper.UserMapper.findById'. I

mybatis报错:A query was run and no Result Maps were found for the Mapped Statement、、Property [login_ip] not found on type [com.thinkgem.jeesite.common.permission.entity.PremissUser]问题解决

今天在做ssm项目的时候出现了: 先是出现 了错误: mybatis报错:A query was run and no Result Maps were found for the Mapped Statement 这是因为Dao.xml中的select标签中必须指定要返回的值的类型(注意:是返回值的单个类型,即如果你是返回一个List<User>的话,需要指定的是User) 具体的这种错误的解决办法见:https://www.cnblogs.com/isme-zjh/p/11757155.h

A query was run and no Result Maps were found for...原来是mapper.xml文件出了问题,是使用MyBatis最常见的一种错误

今天遇到一个问题,原来是mapper.xml文件出了问题,是使用MyBatis最常见的一种错误 报错的结果是这样的: A query was run and no Result Maps were found for the Mapped Statement 'cn.zrgk.dao.RoleMapper.getRoleList'. It's likely that neither a Result Type nor a Result Map was specified. org.apache.

mybatis配置文件xxxx.xml中缺失返回类型的后果A query was run and no Result Maps were found

使用mybatis时出现异常问题: 有如下的错误 Error querying database.  Cause: org.apache.ibatis.executor.ExecutorException: A query was run and no Result Maps were found for the Mapped Statement (后面内容省略) 网上说是oracle不允许插入空值. 但是我没有进行插入操作的,只是进行了查询. 后来看看mybatis的配置文件,漏了一项:res

MyBatis出错Result Maps collection does not contain value for java.lang.Integer

Servlet.service() for servlet [SpringMVC] in context with path [/eyou] threw exception [Request processing failed; nested exception is org.apache.ibatis.builder.IncompleteElementException: Could not find result map java.lang.Integer] with root causej

Result Maps collection already contains value for org.gwj.ssm.dao.CompanyMapper.BaseResultMap

八月 01, 2017 2:48:13 下午 org.apache.tomcat.util.digester.SetPropertiesRule begin 警告: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:ssm' did not find a matching property. 八月 01, 2017 2:4

笔记:MyBatis Mapper XML文件详解 - Result Maps

Result Maps(结果集) resultMap 元素是 MyBatis 中最重要最强大的元素.它就是让你远离 90%的需要从结果 集中取出数据的 JDBC 代码的那个东西, 而且在一些情形下允许你做一些 JDBC 不支持的事 情. 事实上, 编写相似于对复杂语句联合映射这些等同的代码, 也许可以跨过上千行的代码. ResultMap 的设计就是简单语句不需要明确的结果映射,而很多复杂语句确实需要描述它们 的关系,你已经看到简单映射语句的示例了,但没有明确的 resultMap.比如: <s