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

 

Mybatis错误(一)org.apache.ibatis.exceptions.PersistenceException

 

映射文件如下:

 

Mybatis错误(一)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。所以换成小写,问题就解决了。

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-02-20
  • 2021-11-04
  • 2021-09-22
  • 2021-08-18
  • 2021-10-08
  • 2022-12-23
猜你喜欢
  • 2021-10-17
  • 2021-12-19
  • 2022-12-23
  • 2021-07-30
  • 2021-11-28
  • 2021-06-29
  • 2022-12-23
相关资源
相似解决方案