org.apache.ibatis.binding.BindingException: Parameter ‘status‘ not found.

这篇具有很好参考价值的文章主要介绍了org.apache.ibatis.binding.BindingException: Parameter ‘status‘ not found.。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

报错信息:

org.apache.ibatis.exceptions.PersistenceException: 
### Error querying database.  Cause: org.apache.ibatis.binding.BindingException: Parameter 'status' not found. Available parameters are [arg2, arg1, arg0, param3, param1, param2]
### Cause: org.apache.ibatis.binding.BindingException: Parameter 'status' not found. Available parameters are [arg2, arg1, arg0, param3, param1, param2]

org.apache.ibatis.binding.BindingException: Parameter ‘status‘ not found.,java,开发语言

原因分析:

从控制层传入的参数,在mapper文件中接收时,要使用@Param注解来进行接收,否则就会不知道哪个参数传的是哪个位置,如果方法中有多个参数,需要使用@Param(SQL参数占位符名称);

org.apache.ibatis.binding.BindingException: Parameter ‘status‘ not found.,java,开发语言

解决方案:

在原代码的基础上添加@Param注解

原mapper代码:

    List<Brand> selectByconect(int status, String brandName, String companyName);

修改之后的mapper代码:

List<Brand> selectByconect(@Param("status") int status, @Param("brandName") String brandName, @Param("companyName") String companyName);

修改完之后,成功获取参数。文章来源地址https://www.toymoban.com/news/detail-652897.html

到了这里,关于org.apache.ibatis.binding.BindingException: Parameter ‘status‘ not found.的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • 解决错误:nested exception is org.apache.ibatis.binding.BindingException

    mybatis报错信息: Error: nested exception is org.apache.ibatis.binding.BindingException: Parameter ‘categoryList’ not found. Available parameters are [arg0, collection, list] 网上搜到的解决办法: 一、多个参数使用@Param注解标识 对于多个参数的情况,mapper.java中用注解标识参数, mapper.xml中才能识别到其值

    2024年02月21日
    浏览(35)
  • nested exception is org.apache.ibatis.binding.BindingException 解决方式汇总

    MyBatis Mapper出现了nested exception is org.apache.ibatis.binding.BindingException: Parameter ‘levelName’ not found. Available parameters are [arg2, arg1, arg0, param3, param1, param2],说明是Mapper接口方法的参数在编译的时候没有按照代码写的参数来进行。需要解决这个问题,可以从以下方面入手。 从Java 1.8开

    2024年02月16日
    浏览(40)
  • 已解决org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.binding.Bi

    已解决org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.binding.Bi org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.binding.Bi 对于org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.binding.BindingException的错误,一般是由于MyBatis配置问题引起的。

    2024年02月08日
    浏览(45)
  • 已解决org.apache.ibatis.type.TypeException: Could not resolve type alias

    已解决org.apache.ibatis.type.TypeException: Could not resolve type alias org.apache.ibatis.type.TypeException: Could not resolve type alias 对于 org.apache.ibatis.type.TypeException: Could not resolve type alias 错误,通常是由于 MyBatis 配置文件中配置的别名无法解析导致的。 下滑查看解决方法 解决方法如下: 首先,请

    2024年02月06日
    浏览(39)
  • idea运行单元测试报Could not find method on interface org.apache.ibatis.executor.Executor named queryCursor

    出现上面的问题是由于idea插件MyBatis Log EasyPlus导致产生的 直接关闭掉这个插件,就能正常运行了 org.apache.ibatis.exceptions.PersistenceException:  ### Error opening session.  Cause: org.apache.ibatis.plugin.PluginException: Could not find method on interface org.apache.ibatis.executor.Executor named queryCursor. Cause: java

    2024年04月28日
    浏览(35)
  • nested exception is org.apache.ibatis.type.TypeException: Could not set parameters for mapping错误的决方法

    今天写好 hive表导入的回调 的接口,如下代码所示: 启动 postman 访问该接口,确报出如下错误: 即 nested exception is org.apache.ibatis.type.TypeException: Could not set parameters for mapping: ParameterMapping{property=\\\'missionId\\\', mode=IN, javaType=class java.lang.Long, jdbcType=null, numericScale=null, resultMapId=\\\'null\\\',

    2024年02月09日
    浏览(31)
  • BindingException: Parameter ‘ids‘ not found. Available parameters are [collection, list]

    记录没见过的Bug之BindingException 今天在写一个删除套餐功能时遇到个bug如下图所示: 我们都知道当一个请求参数有多个值接收时可以采用如下方式:                1. 使用数组接收   Long[] ids                2. 使用集合接收  ListLong ids  注意: 如果使用集合需要添加@Re

    2023年04月17日
    浏览(30)
  • 【已解决】org.apache.ibatis.exceptions.PersistenceException

    本博文源于笔者自身学习的mybatis,在学习一对多的过程中,出现了一个错误。这个错误是org.apache.ibatis.exceptions.PersistenceException: Error building SqlSession. The error may exist in mappers/EmpMapper.xml The error occurred while processing mapper_resultMap[empAndDeptResultMapTwo]_association[dept] Cause: org.apache.ibatis

    2024年02月12日
    浏览(44)
  • MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException

    连不上数据库!!! 检查配置项是否错误! 127.0.0.1 漏了个1

    2024年02月13日
    浏览(33)
  • org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.TooManyR

    org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.TooManyResultsException: Expected one result (or null) to be returned by selectOne(), but found: 2 这个错误是我在集成SpringBoot项目测试数据库时遇到的问题。这是Mybatis最常见的一个异常TooManyResultsException。 原因:看报错的信息,

    2024年02月10日
    浏览(32)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包