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文件出了问题

十月 29, 2019 10:25:10 上午 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即可

原文地址:https://www.cnblogs.com/isme-zjh/p/11757458.html

时间: 2024-11-10 00:48:56

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]问题解决的相关文章

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

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. 导致这个错误

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报错:Parameter &#39;list&#39; not found. Available parameters are [groupList, param1]

GroupDao.java 里面定义的方法: void batchInsertLog(@Param("groupList") List<MktPromotionIntegralLog> groupList); 修改前的GroupMapper.xml <insert id="batchInsertLog" parameterType="java.util.List"> INSERT INTO table (ps_id,goo

Mybatis 报错 There is no getter for property named &#39;***&#39; in &#39;class java.lang.String&#39;

在mapper.xml中 , 如果单参数是String类型 , 且在sql语句中对参数进行了判断 , 如下 when 中的判断 , 如果出现 if 判断也是一样的.都需要把判断中的参数用 _parameter 来代替 ,. 另外orcal中判断字段是否为空需要使用 is null , 同理,判断不为空使用 is not null . 错误查询: <select id = "select" resultMap="ResultMap" parameterType=

mybatis报错Mapped Statements collection does not contain value for com.inter.IOper

首页 > 精品文库 > mybatis报错Mapped Statements collection does not contain value for com.inter.IOper mybatis报错Mapped Statements collection does not contain value for com.inter.IOper 2015-04-09 浏览(52) [摘要:正在顺序挪用IOperation接心中的getAllItems方式时,涌现了以下毛病: Exception