zoukankan      html  css  js  c++  java
  • mybatis入参错误:There is no getter for property named ‘status‘ in ‘class java.lang.Integer‘

    前因后果
    今天做一个查询功能遇到一个Mybatis的反射异常,报这个错我还是觉得蛮奇怪的,具体情况就是单个入参在String类型下不报错,在Integer类型的情况下居然报一个反射异常:
    org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.reflection.ReflectionException: There is no getter for property named ‘status’ in ‘class java.lang.Integer’…后面省略N行报错信息。

    查询报错,参数写法如下:

    List<demo> findLst(Integer status);
    

    解决方法:在参数上加@Param注解:

    List<demo> findLst(@Param("status") Integer status);
    

    需要知道具体原因的可看下Mybatis源代码了解一下。

  • 相关阅读:
    router使用以及vue的动画效果
    配置wbepack
    Axios插件和loading的实现
    自定义组件的 v-model
    组件模块化使用
    组件基础
    vue的使用1
    solt插槽的使用。
    Vue的使用
    Vue的router使用
  • 原文地址:https://www.cnblogs.com/javakfz/p/13938243.html
Copyright © 2011-2022 走看看