使用方法:
1.添加version锁标记字段
2.实体类添加对应字段,并加上@Version注解
3.添加配置类
@Configuration
public class MpComfig {@Beanpublic MybatisPlusInterceptor mpInterceptor(){MybatisPlusInterceptor mpInterceptor = new MybatisPlusInterceptor();mpInterceptor.addInnerInterceptor(new OptimisticLockerInnerInterceptor());return mpInterceptor;}
}