加入樂(lè)觀鎖導(dǎo)致自動(dòng)填充updateTime失效
我在正常的自動(dòng)填充測(cè)試的時(shí)候time都是正常自動(dòng)插入了,然后配置了樂(lè)觀鎖就導(dǎo)致updateTime插入為null。
@Configuration public?class?MybatisPlusConfiguration?{ ????//??樂(lè)觀鎖插件 ????@Bean ????public?OptimisticLockerInterceptor?optimisticLockerInterceptor()?{ ????????return?new?OptimisticLockerInterceptor(); ????} }
@Version private?Integer?version;
這兩個(gè)我都加了,這是什么情況?老師請(qǐng)教下。
2020-02-08
同學(xué),你用的Mybatis-Plus是哪個(gè)版本?我也試試。
2020-02-09
3.3.0版本