فهرست منبع

合并一个 pr 待验证

= 8 سال پیش
والد
کامیت
d0a1772c79
1فایلهای تغییر یافته به همراه7 افزوده شده و 0 حذف شده
  1. 7 0
      src/main/java/com/baomidou/mybatisplus/plugins/OptimisticLockerInterceptor.java

+ 7 - 0
src/main/java/com/baomidou/mybatisplus/plugins/OptimisticLockerInterceptor.java

@@ -76,6 +76,13 @@ public class OptimisticLockerInterceptor implements Interceptor {
             if(map.containsKey(NAME_ENTITY_WRAPPER)){//mapper.update(updEntity, EntityWrapper<>(whereEntity);
             if(map.containsKey(NAME_ENTITY_WRAPPER)){//mapper.update(updEntity, EntityWrapper<>(whereEntity);
                 ew = (Wrapper) map.get(NAME_ENTITY_WRAPPER);
                 ew = (Wrapper) map.get(NAME_ENTITY_WRAPPER);
             }//else updateById(entity) -->> change updateById(entity) to updateById(@Param("et") entity)
             }//else updateById(entity) -->> change updateById(entity) to updateById(@Param("et") entity)
+
+            // TODO 待验证逻辑
+            // if mannual sql or updagteById(entity),unsupport OCC,proceed as usual unless use updateById(@Param("et") entity)
+            //if(!map.containsKey(NAME_ENTITY)) {
+            //    return invocation.proceed();
+            //}
+
             Object et = map.get(NAME_ENTITY);
             Object et = map.get(NAME_ENTITY);
             if(ew!=null){
             if(ew!=null){
                 Object entity = ew.getEntity();
                 Object entity = ew.getEntity();