配置mybatisplus乐观锁的过程

1、在数据库表中添加version字段类型int

2、在实体类中增加version属性,属性上增加@Version注解

3、配置乐观锁插件

@Configuration
public class MyBatisConfig { //乐观锁插件
@Bean
public MybatisPlusInterceptor mybatisPlusInterceptor(){
MybatisPlusInterceptor interceptor =new MybatisPlusInterceptor();
interceptor.addInnerInterceptor(new OptimisticLockerInnerInterceptor());
return interceptor;
}
}

提示Parameter 'MP_OPTLOCK_VERSION_ORIGINAL' not found. Available parameters are [param1, et]是因为mybatisplus版本的原因, 新的版本这样配置相当于没有生效,老本的是OptimisticLockerInterceptor已经过时了

参考:https://baomidou.com/pages/0d93c0/#_1-%E9%85%8D%E7%BD%AE%E6%8F%92%E4%BB%B6

MyBatisPlus 报MP_OPTLOCK_VERSION_ORIGINAL not found. Available parameters are错误的更多相关文章

  1. SpringBoot集成MybatisPlus报错

    SpringBoot集成MybatisPlus报错 启动的时候总是报如下错误: java.lang.annotation.AnnotationFormatError: Invalid default: ...

  2. 解决JS中missing ( before function parameters的错误

    在编写javascript中,常出现在function处提示“missing ( before function parameters”的错误,这是怎么回事? 例如: function String. ...

  3. 登陆Oracle,报oracle initializationg or shutdown in progress 错误提示

    前两天,登陆Oracle,发现登陆不上去了,报”oracle initializationg or shutdown in progress 错误提示” 错误. 然后就想着怎么去解决,首先自己到win ...

  4. 使用tortoisegit工具git地址中带号码密码的拉取,以及使用这种方式后中途重置密码报git remote: HTTP Basic: Access denied 错误解决办法

    1. 在拉取git项目时可以在地址中直接指定号码密码如下就可以直接拉取下来 https://username:password@github.com   需要注意,因为在解析地址时是以@符号作为地址信 ...

  5. Hbase启动hbase shell运行命令报Class path contains multiple SLF4J bindings.错误

    1:Hbase启动hbase shell运行命令报Class path contains multiple SLF4J bindings.错误,是因为jar包冲突了,所以对于和hadoop的jar包冲 ...

  6. 用element-ui 时,报value.getTime is not a function错误:

    在用element-ui 时,报value.getTime is not a function错误:错误分析:date-picker 的时间是格林威时间,如果Thu Jun 22 2017 19:07 ...

  7. delphi 10.1 berlin datasnap提交clientdataset.delta报:invalid variant type conversion(类型转换错误)问题的解决

    delphi 10.1 berlin datasnap提交clientdataset.delta报:invalid variant type conversion(类型转换错误)问题的解决,需要打这个 ...

  8. Windows任务计划向远程服务器拷贝文件,报登录失败: 未知的用户名或错误密码

    问题产生很奇怪,当你登录到系统时,执行自动化作业是正常 但到了晚上凌晨自动执行作业时,则报登录失败: 未知的用户名或错误密码 解决方案: 在拷贝脚本中加及一行,创建net use 命名,每次文件拷贝前 ...

  9. jenkins添加环境变量 ,win 10的 环境变量如下,win7 就是不加也可以运行,不报 “python 不是内部命令 ” 的错误。

    jenkins 添加win 10的 环境变量如下,win7 就是不加也可以运行,不报 “python 不是内部命令 ” 的错误,暂时不知道怎么回事.    jenkins这样添加环境变量 .

  10. 运行nodejs项目报Process finished with exit code 1 错误

    在项目中,明明在别人的机子上项目可以运行,但是复制到自己的电脑就无法就无法启动.报Process finished with exit code 1错误,也没提示错误地方.自己倒腾了很久总结了几个解决 ...

随机推荐

  1. JZOJ 3232. 【佛山市选2013】排列

    题目 解析 很神奇的一道题 显然,对于一种排列,相当于给出了数字 \(1..n\) 的对应关系,且不重复不遗漏,刚好把 \(1\) 到 \(n\) 又包含了一遍. 对,连边! 每个数向它对应的数连边, ...

  2. Vulhub 漏洞学习之:ElasticSearch

    Vulhub 漏洞学习之:ElasticSearch 目录 Vulhub 漏洞学习之:ElasticSearch 1 ElasticSearch 命令执行漏洞(CVE-2014-3120)测试环境 1 ...

  3. 代码随想录算法训练营day07 | leetcode 454.四数相加II 383. 赎金信 15. 三数之和 18. 四数之和

    LeetCode 454.四数相加II 分析1.0 这个最直接暴力法,不过过于暴力了,害怕.jpg 失误 读题理解失误:题目要求的是四元组的个数,读完题到我这里成了输出四元组,悲哉 分析2.0 记录有 ...

  4. Sublime Text 3怎么配置本地服务器?

    1. 同样的我们需要借助一款插件来实现. 2.打开Sublime,使用快捷键[Ctrl + Shift + P]或者点击"Preferences"=> "Packa ...

  5. windows pwn(一)

    前言 前几天因为看CS shellcode装了一个win10虚拟机,然后正好因为逆向课老师要装一系列工具.于是就想起来之前一直想看的windows pwn,就顺便装了一下相关工具并且入门了一下. 工具 ...

  6. Angular 利用路由快照实现tab

    1.定义路由快照 新建文件SimpleReuseStrategy.ts import { RouteReuseStrategy, DefaultUrlSerializer, ActivatedRout ...

  7. js手动触发页面元素点击事件,自定义点击事件模拟点击

    // initEvent事件已经弃用1. 创建MouseEvents事件const clickEvent = document.createEvent('MouseEvents')2. 初始化点击事件 ...

  8. dismount ASM磁盘组,影响未使用的其它ASM磁盘组

    # 问题概述登录数据库,查看活动会话,发现大量library cache lock ,log file switch (archiving needed),归档失败,redo log无法重用.# 问题 ...

  9. CMT: Convolutional Neural Networks Meet Vision Transformers概述

    0.前言 相关资料: arxiv github 论文解读(CSDN,CSDN) 论文基本信息: 作者单位:华为诺亚, 悉尼大学 发表时间:CVPR2022(2021.7.13) 1.针对的问题 当前将 ...

  10. ImportError: cannot import name 'six' from 'django.utils'的解决办法

    解决办法 对于3.x版本的django,安装django-utils-six2.0 pip install django-utils-six