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.html
当我解决完之后,又出现了一个新的问题:见下面:
Caused by: org.apache.ibatis.exceptions.PersistenceException: ### 。。。。
The error may involve com.thinkgem.jeesite.common.permission.dao.PremissUserDao.getPremissUserList ### The error occurred while handling results

原因:一般都是自己的Dao对应的xml文件出了问题
我这里是select 标签的id指定了,大但是select标签中的查询语句返回的类型没有指定,也就是没有resultType参数,还有一个需要注意的点是:这里参数需要指定的是返回的单个的java类型,即是如果你通过查询需要返回的是一个lIst<xxx>的话,你在这个参数的位置也需要指定的是单个的java的类型,而不是指定为java.util.List
错误的代码
<select id="getPremissUserList" resultType="java.util.List">
select
<include refid="premissUserColumns"/>
from premiss_user u
<include refid="premiss_user_join"/>
</select>
项目的时候出现了:
Caused by: org.apache.ibatis.exceptions.PersistenceException: ### 。。。。
The error may involve com.thinkgem.jeesite.common.permission.dao.PremissUserDao.getPremissUserList ### The error occurred while handling results
原因分析:
我自己去 网上查的时候发现大家出现【Caused by: org.apache.ibatis.exceptions.PersistenceException:】错误的时候,大多是自己的Mapper配置文件除了问题,所以去仔细检查自己的Mapper.xml吧!
我这里是select 标签的id指定了,大但是select标签中的查询语句返回的类型没有指定,也就是没有resultType参数,还有一个需要注意的点是:这里参数需要指定的是返回的单个的java类型,即是如果你通过查询需要返回的是一个lIst<xxx>的话,你在这个参数的位置也需要指定的是单个的java的类型,而不是指定为java.util.List
错误的代码
<select id="getPremissUserList" resultType="java.util.List">
select
<include refid="premissUserColumns"/>
from premiss_user u
<include refid="premiss_user_join"/>
</select>
正确的:
<select id="getPremissUserList" resultType="com.thinkgem.jeesite.common.permission.entity.PremissUser">
select
<include refid="premissUserColumns"/>
from premiss_user u
<include refid="premiss_user_join"/>
</select>
之后又遇见的一个新的问题:这个应该是相应的用到login_ip的jsp文件出了问题
十月 , :: 上午 org.apache.catalina.core.StandardWrapperValve invoke
严重: Servlet.service() for servlet [springServlet] in context with path [/Demo] threw exception [javax.el.PropertyNotFoundException: Property [login_ip] not found on type [com.thinkgem.jeesite.common.permission.entity.PremissUser]] with root cause
javax.el.PropertyNotFoundException: Property [login_ip] not found on type [com.thinkgem.jeesite.common.permission.entity.PremissUser]
问题出现

更改为user这个实体类中有的loginIp即可
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]问题解决的更多相关文章
- 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 ...
- 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 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.ExecutorExceptio ...
- 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 ...
- 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 ...
- 出错: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 ...
- mybatis配置文件xxxx.xml中缺失返回类型的后果A query was run and no Result Maps were found
使用mybatis时出现异常问题: 有如下的错误 Error querying database. Cause: org.apache.ibatis.executor.ExecutorExcepti ...
- 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报错 Error instantiating interface com.atguigu.mybatis.dao.DepartmentMapper with invalid types () or values ()
mybatis报错 Error instantiating interface com.atguigu.mybatis.dao.DepartmentMapper with invalid types ...
随机推荐
- Linux的文件、目录权限管理
查看文件夹的详细信息 [root@s25linux ~]# ll /tmp总用量 4drwxr-xr-x. 2 root root 6 2月 17 11:00 hehe #文件夹 解读它的信息 ...
- 论文阅读笔记(十)【CVPR2016】:Recurrent Convolutional Network for Video-based Person Re-Identification
Introduction 该文章首次采用深度学习方法来解决基于视频的行人重识别,创新点:提出了一个新的循环神经网络架构(recurrent DNN architecture),通过使用Siamese网 ...
- pip工具下载速度慢的问题
由于pip安装默认的访问地址为 http://pypi.python.org/simple/ 为外网,速度慢而且容易超时报错 国内常用的镜像源有 :阿里云 http://mirrors.aliyun. ...
- vjudge A Funny Game 思维题 (其实今天讲的全是数学。。。)
原文链接https://vjudge.net/contest/331993#problem/H Alice and Bob decide to play a funny game. At the be ...
- MyBatis的手动映射与模糊查询
一.手动映射 当实体类属性与数据库字段名不同时,无法自动映射,导致查询出空值,这时候可以使用手动映射 在select节点添加resultMap属性与resultMap节点建立关系
- linux 安装 setuptools
wget --no-check-certificate https://pypi.python.org/packages/source/s/setuptools/setuptools-19.6.tar ...
- 题解 CF409A 【The Great Game】
题目传送门. 思路: 首先我们定义\(2\)个字符串,分别存放 TEAM 1 与 TEAM 2 的出招顺序.接着再定义\(2\)个变量,存放 TEAM 1 与 TEAM 2 的分数. string s ...
- vscode里的NPM脚本
NPM脚本的开启与关闭 点击设置-功能-任务 控制为所有任务提供程序扩展启用"提供任务".如果"任务:运行任务"命令速度较慢,则禁用任务提供程序的自动检测可能会 ...
- 从客户端中检测到有潜在危险的request.QueryString
1. 修改 web.config文件 1.1 <pages validateRequest="false"></pages> (如果存在这个节点 直接加属性 ...
- FormData控制台打印为空及使用方法
之前使用formData都是在network中查看参数,最近在做一个项目,接口还没有,用的假数据做的交互,突发奇想的console.log了 一下,结果是空的. 一开始以为append失效了,经过查证 ...