MyBatisSystemException传参异常错误

MyBatisSystemException传参异常错误,第1张

今天遇到的一个小问题

测试代码时报的异常:

org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.binding.BindingException: Parameter 'invoiceno' not found. Available parameters are [param, arg0, param1, param2]
 

原因是在方法上添加了注解@Param("param"),而sql传参时虽然也写param

但是if判断里却没有添加,所以正确的写法应该是 这样

另一个错误就是参数大小写问题

org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'sendStatus' 

找到对应的实体类,要么里面没有sendStatus这个参数,要么就是大小写的问题,修改参数为sendstatus就可以了

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/langs/730576.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-04-27
下一篇 2022-04-27

发表评论

登录后才能评论

评论列表(0条)

保存