在映射文件中,通过parameterType指定输入参数的类型,类型可以是简单类型、hashmap、pojo的包装类型。在测试包装类型过程中产生了一个错误:org.apache.ibatis.exceptions.PersistenceException、错误如下。

映射文件如下:

我们来看着错误提示:There is no getter for property named 'UserCustom' in 'class com.murongtech.mybatis.domain.UserQueryVo'  大致意思是在UserQueryVo类中属性UserCustom 没有相应的get方法。这里就是问题的所在了,我在SQL中使用#{UserCustom.sex},而我在UserQueryVo定义的属性是小写开头的userCustom。所以换成小写,问题就解决了。

Mybatis错误(一)org.apache.ibatis.exceptions.PersistenceException的更多相关文章

  1. mybatis bug之org.apache.ibatis.exceptions.PersistenceException:

    详细报错信息: org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause: java. ...

  2. org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause: java.lang.NumberFormatException: For input string: "W%" ### Cause: java.lang.NumberFormatException: For input s

    一个常见的myBatis xml文件中的引号错误: org.apache.ibatis.exceptions.PersistenceException: ### Error querying data ...

  3. HTTP Status 500 - org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException:

    HTTP Status 500 - org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.e ...

  4. mybatis <fireach> 拼接sql语句 org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause: org.apache.ibatis.builder.BuilderException: Error evaluating expression 'in'. Cause:

    <select id="getUserIn" parameterType="QueryVo" resultMap="userMap"& ...

  5. MyBatis-Exception:org.apache.ibatis.exceptions.PersistenceException

    错误信息如下: HTTP Status 500 - org.mybatis.spring.MyBatisSystemException: nested exception is org.apache. ...

  6. MyException--org.apache.ibatis.exceptions.PersistenceException: ### Error building SqlSession. ###

    org.apache.ibatis.exceptions.PersistenceException:  ### Error building SqlSession. ### The error may ...

  7. org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manu

    这个是sql 语句 错误     仔细检查 SQL语句是否写错了 org.apache.ibatis.exceptions.PersistenceException: ### Error queryi ...

  8. org.apache.ibatis.exceptions.PersistenceException:

    org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause: java.lang.Ill ...

  9. org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure The last packet sent succ

    数据库 没有开启  连接失败 org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause ...

随机推荐

  1. sql操作

    SQL Server 存储过程 Transact-SQL中的存储过程,非常类似于Java语言中的方法,它可以重复调用.当存储过程执行一次后,可以将语句缓存中,这样下次执行的时候直接使用缓存中的语句.这 ...

  2. 如何写出优雅兼备可读性的javascript代码

    即或是最简单的需求,不同的程序员也会写出不一样的代码: 需求:充值程序过虑不符合条件的充值金额,即只能充入100.200.500.1000金额,其它过虑: 1.菜鸟程序员可能会这样写,虽然可读性强,代 ...

  3. 猿团YTFCloud生态系统,全面服务创业者

    9月15日,YTFCloud已正式开启了内测. 创业者翘首以待的YTFCloud,虽然让部分创业者感受到了它的神奇,但对于更多暂时无法尝试的创业者来说,它依然有一层神秘的面纱. 今天小编就来带你近距离 ...

  4. 响应式web设计之CSS3 Media Queries

    开始研究响应式web设计,CSS3 Media Queries是入门. Media Queries,其作用就是允许添加表达式用以确定媒体的环境情况,以此来应用不同的样式表.换句话说,其允许我们在不改变 ...

  5. UVA 12299 RMQ with Shifts(线段树:单点更新)

    题目链接:https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem ...

  6. c++ STL中的vector与list为什么没有提供find操作?

    map里有,set里也有,vector,list没有,太不公平了吧. 其实应该考虑为什么map,set里有find操作. include<algorithm>里有通用的find操作,通用的 ...

  7. 03、AngularJs的模块与控制器

    大部分的应用程序都有一个主方法(main)来组织,实例化,启动应用程序.而AngularJs应用是没有主方法的,它是通过模块来声明应用应该如何启动的.同时,模块允许声明来描述应用中依赖关系,以及如何进 ...

  8. AOP 事务

    定义 AOP实际可以通过预编译方式和运行期动态代理实现在不修改源代码的情况下给程序动态统一添加功能的一种技术,非业务类横切于业务类), 通过AOP以动态和非入侵方式来增强服务 事务的四大属性:ACID ...

  9. 1.iOS直播ijkplayer(第一周)

    准备工作: 1.使用的B站的开源框架ijkplayer ,下载地址: https://github.com/Bilibili/ijkplayer ijkplayer 是一个基于 ffplay 的轻量级 ...

  10. 快速排序-java

    排序-快速排序 基本思想: 将数据划分为两部分,左边的所有元素都小于右边的所有元素:然后,对左右两边进行快速排序. 划分方法: 选定一个参考点(中间元素),所有元素与之相比较,小的放左边,大的放右边. ...