在练习ssmp整合的时候遇到了下面报错信息

Caused by: org.apache.ibatis.binding.BindingException: Parameter 'MP_OPTLOCK_VERSION_ORIGINAL' not found. Available parameters are [param1, et]at org.apache.ibatis.binding.MapperMethod$ParamMap.get(MapperMethod.java:212)at org.apache.ibatis.reflection.wrapper.MapWrapper.get(MapWrapper.java:45)at org.apache.ibatis.reflection.MetaObject.getValue(MetaObject.java:122)at com.baomidou.mybatisplus.core.MybatisParameterHandler.setParameters(MybatisParameterHandler.java:205)at org.apache.ibatis.executor.statement.PreparedStatementHandler.parameterize(PreparedStatementHandler.java:94)at org.apache.ibatis.executor.statement.RoutingStatementHandler.parameterize(RoutingStatementHandler.java:64)at sun.reflect.GeneratedMethodAccessor59.invoke(Unknown Source)at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)at java.lang.reflect.Method.invoke(Method.java:498)at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:64)at com.sun.proxy.$Proxy84.parameterize(Unknown Source)at org.apache.ibatis.executor.SimpleExecutor.prepareStatement(SimpleExecutor.java:88)at org.apache.ibatis.executor.SimpleExecutor.doUpdate(SimpleExecutor.java:49)at org.apache.ibatis.executor.BaseExecutor.update(BaseExecutor.java:117)at org.apache.ibatis.executor.CachingExecutor.update(CachingExecutor.java:76)at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)at java.lang.reflect.Method.invoke(Method.java:498)at org.apache.ibatis.plugin.Invocation.proceed(Invocation.java:49)at com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor.intercept(MybatisPlusInterceptor.java:106)at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:62)at com.sun.proxy.$Proxy83.update(Unknown Source)at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:194)at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)at java.lang.reflect.Method.invoke(Method.java:498)at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:427)... 58 more

报错信息是Caused by: org.apache.ibatis.binding.BindingException: Parameter ‘MP_OPTLOCK_VERSION_ORIGINAL’ not found. Available parameters are [param1, et]

经过分析原来是只配置了分页的拦截器而忘记在mybatis-plus拦截器中添加乐观锁拦截器

需要在mybatis-plus拦截器的配置中添加OptimisticLockerInnerInterceptor()

@Beanpublic MybatisPlusInterceptor mybatisPlusInterceptor(){MybatisPlusInterceptor mpi = new MybatisPlusInterceptor();//添加分页拦截器mpi.addInnerInterceptor(new PaginationInnerInterceptor());//添加乐观锁拦截器mpi.addInnerInterceptor(new OptimisticLockerInnerInterceptor());return mpi;}

配置mybatis-plus乐观锁的步骤
1、先在数据库表中添加version字段
2、在实体类中定义version字段,并使用@Version注解标记
3、在mybatis-plus拦截器中添加OptimisticLockerInnerInterceptor()乐观锁拦截器

这三步都仔细检查一下,应该就没有问题了

解决Parameter ‘MP_OPTLOCK_VERSION_ORIGINAL‘ not found. Available parameters are [param1, et]的问题相关推荐

  1. 解决Parameter ‘__frch_item_0‘ not found. Available parameters 问题

    解决Parameter '__frch_item_0' not found. Available parameters 问题 参考文章: (1)解决Parameter '__frch_item_0' ...

  2. Parameter 'goodsName' not found. Available parameters are [ param1, goods]

    1. 报错 (mybatis) nested exception is org.apache.ibatis.binding.BindingException: Parameter 'goodsName ...

  3. Parameter 'attendance' not found. Available parameters are [param1, attendance, sid, param2]解决方法

    记录一下今天做项目出现的问题以及解决方案. 一.项目的部分代码 pojo层 public class Attendance {private Integer id;private Staff staf ...

  4. 错误:Parameter ‘0‘ not found.Available parameters are [arg1, arg0, param1, param2]的解决方法

    错误:Parameter '0' not found.Available parameters are [arg1, arg0, param1, param2]的解决方法 参考文章: (1)错误:Pa ...

  5. Parameter 'userid' not found. Available parameters are [arg1, arg0, param1, param2]的解决办法

    HTTP Status 500 – Internal Server Error Type 异常报告 消息 Request processing failed; nested exception is ...

  6. org.apache.ibatis.binding.BindingException: Parameter 'username' not found. Available parameters

    错误信息: ### Error updating database. Cause: org.apache.ibatis.binding.BindingException: Parameter 'use ...

  7. idea运行报错Parameter ‘name‘ not found. Available parameters are [arg1, arg0, param1, param2]

    Parameter 'name' not found. Available parameters are [arg1, arg0, param1, param2] 出现问题: 在mapper或者dao ...

  8. 【问题记录】04 MyBatis报错:Parameter ‘XXX‘ not found. Available parameters are [page, hashMap, param1, param

    1.报错信息如下: nested exception is org.apache.ibatis.binding.BindingException:Parameter 'XXX' not found. ...

  9. Parameter 'propertyName' not found. Available parameters are [propertyInformation, id, param1, para

    报错: Parameter 'propertyName' not found. Available parameters are [propertyInformation, id, param1, p ...

最新文章

  1. Android核心分析之二十三Andoird GDI之基本原理及其总体框架
  2. Work Management Service application in SharePoint 2016
  3. 微信小程序- 初试小程序之tabbar(选项卡,底部导航)的使用
  4. 简单地利用canvas载入视频
  5. BZOJ1857:[SCOI2010]传送带——题解
  6. 010. 使用.net框架提供的属性
  7. flutter SlideTransition实现平移动画
  8. php定时任务sw,[原创]Swoole和Swoft的那些事(Task投递/定时任务篇)
  9. 服务器自动post,Go Web服务器自动重定向POST请求
  10. python chardet_Python - chardet
  11. string 转换int
  12. 开源公司黄页之阿里巴巴开源软件推荐(一)
  13. python 正则表达式 符号及其定义
  14. android.os.DeadObjectException的解决办法
  15. 中源幼儿园收费管理系统 pdf软件
  16. C#使用PDF控件打开PDF
  17. 【学生考勤管理系统】 学生考勤打卡系统 学生打卡学生考试系统 学生OA系统
  18. 在VM虚拟机上装“黑苹果
  19. 2022年我国城镇污水处理运营市场空间可达730亿元
  20. Dell服务器电源配置规则

热门文章

  1. 3.TransposedConv2d实现 (含dilation)
  2. python开发前端后端区别_前端开发与后端开发有什么区别?
  3. 微信小程序:微信公众号关联小程序步骤
  4. 南开大学张昊计算机,附件F学生参加百项工程和国创情况-南开大学电子信息教学.DOC...
  5. HR的简历筛选神器,你拥有了吗?
  6. java摩斯密码解密_[代码全屏查看]-摩斯密码转换-JAVA版
  7. 第四章 CSS入门 A卷
  8. 矩阵与矩阵相乘python代码实现
  9. 歪打正着之:免费杀毒软件和芝华士广告
  10. Virtual Serial Port Driver 虚拟串口工具软件 使用介绍