mybatis-plus乐观锁报Parameter ‘MP_OPTLOCK_VERSION_ORIGINAL‘ not found. Available parameters are [param1]

 

根据mybatis-plus 官网文档配置乐观锁,报如下错误

 

 经过排查发现是因为乐观锁插件引起的,因为mybatis-plus版本升级造成老版本配置方式不生效

public class MybatisPlusConfig {
  // 注册乐观锁插件
  @Bean
  public OptimisticLockerInnerInterceptor optimisticLockerInnerInterceptor(){
    return new OptimisticLockerInnerInterceptor();
  }
}

 

正确写法:

 

posted @ 2021-11-24 11:38  今天又下小雨  阅读(1837)  评论(0编辑  收藏  举报