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 Result Map was specified.
使用mybatis时出现异常问题:
有如下的错误
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 Result Map was specified.
这个是使用MyBatis最常见的一种错误,从其描述来看是user.insertUser!selectKey这个Statement没有Result Type或Result Map。下面是我的配置文件的statement:
<insert id="insertUser" parameterType="com.luchao.mybatis.first.po.User">
<selectKey keyProperty="id" order="AFTER" >
select LAST_INSERT_ID()
</selectKey>
insert into user(username,birthday,sex,address) value (#{username},#{birthday},#{sex},#{address});
</insert>
可以看出主要是<selectKey>没有resultType所致的。
mybatis中不管什么查询,都必须返回resultType或者resultMap的值,否则就会报错的。
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 Result Map was specified.的更多相关文章
- 出错: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'.
详细出错代码: org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause: org.a ...
- A query was run and no Result Maps were found for the Mapped Statement
mybatis测试方法报错: org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exec ...
- mybatis使用map传递多参数报错:A query was run and no Result Maps were found for the Mapped Statement
在使用mybatis进行多参数传递时,报错: A query was run and no Result Maps were found for the Mapped Statement 'xx.xx ...
- 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.m ...
- 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 St ...
- 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 quer ...
- 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 f ...
- mybatis配置文件xxxx.xml中缺失返回类型的后果A query was run and no Result Maps were found
使用mybatis时出现异常问题: 有如下的错误 Error querying database. Cause: org.apache.ibatis.executor.ExecutorExcepti ...
- java.lang.IllegalArgumentException: Result Maps collection does not contain value for java.lang.Integer
今天做springmvc+mybatis+spring的项目的时候发现了一个异常.如下: org.apache.ibatis.builder.IncompleteElementException: C ...
随机推荐
- Azure Linux VM Swap 分区
默认情况下,Windows Azure上的Linux VM是没有Swap分区的.下面我们以Ubuntu为例,为Windows Azure上的Linux虚拟机创建Swap分区. Windows Azur ...
- 大话设计模式C++版——简单工厂模式
简单工厂模式应该是所有设计模式中最简单,也最基础的一种模式,以下是一个简单的采用工厂模式写一个加减法的计算器. 1.抽象接口类——依赖倒转原则(高层和底层都要依赖于抽象,针对接口编程) class I ...
- Java JDBC高级特性
1.JDBC批处理 实际开发中需要向数据库发送多条SQL语句,这时,如果逐条执行SQL语句,效率会很低,因此可以使用JDBC提供的批处理机制.Statement和PreparedStatemen都实现 ...
- sobel算子原理及opencv源码实现
sobel算子原理及opencv源码实现 简要描述 sobel算子主要用于获得数字图像的一阶梯度,常见的应用和物理意义是边缘检测. 原理 算子使用两个33的矩阵(图1)算子使用两个33的矩阵(图1)去 ...
- (六)责任链模式-C++实现
使多个对象都有机会处理请求,从而避免请求的发送者和接收者之间的耦合关系.将这些对象连成一条链,并沿着这条链传递请求,直到有一个对象处理它为止. 责任链模式是使用多个对象处理用户请求的成熟模式,它的关键 ...
- iOS Block详细介绍(block实现)
Block的实现 数据结构定义 block的数据结构定义如下图 对应的结构体定义如下: struct Block_descriptor { unsigned long int reserved; un ...
- JS常用自定义方法
1,JS生成随机数方法 getRandom(100),表示生成0-100的数 function getRandom(n){ return Math.floor(Math.random()*n+1) } ...
- Windows 8.1 新增控件之 Flyout
本篇为大家介绍Flyout 控件,Flyout 属于一种轻量级交互控件,可以支持信息提示或用户交互.与传统Dialog 控件不同的是Flyout 控件可通过直接点击对话框外部区域忽略. Flyout ...
- 招聘高级.Net工程师
找钢网创新开发部真诚地邀请程序猿\媛们加入,一起来吃大闸蟹午餐. 在创新开发部你可以见证一个产品从零开始到爆发到改变一个大宗商品的行业,在创新开发部你有机会接触到国际范,你还有机会接触到韩国的妹纸.欧 ...
- OS X运行AFNI的AlphaSim提示libgomp.1.dylib找不到的解决办法
运行环境:OS X Mavericks 10.9.4,AFNI 问题描述: 运行AlphaSim命令时,提示以下信息dyld: Library not loaded: /usr/local/lib/l ...