Przeglądaj źródła

优化Wrapper类中boolean方法的名称,解决OGNL解析中method缓存问题 github pull/5380

hubin 2 lat temu
rodzic
commit
cd3715563d

+ 19 - 4
mybatis-plus-core/src/main/java/com/baomidou/mybatisplus/core/conditions/Wrapper.java

@@ -98,10 +98,15 @@ public abstract class Wrapper<T> implements ISqlSegment {
     /**
      * 查询条件不为空(包含entity)
      */
-    public boolean nonEmptyOfWhere() {
+    public boolean isNonEmptyOfWhere() {
         return !isEmptyOfWhere();
     }
 
+    @Deprecated
+    public boolean nonEmptyOfWhere() {
+        return isNonEmptyOfWhere();
+    }
+
     /**
      * 查询条件为空(不包含entity)
      */
@@ -112,16 +117,21 @@ public abstract class Wrapper<T> implements ISqlSegment {
     /**
      * 查询条件为空(不包含entity)
      */
-    public boolean nonEmptyOfNormal() {
+    public boolean isNonEmptyOfNormal() {
         return !isEmptyOfNormal();
     }
 
+    @Deprecated
+    public boolean nonEmptyOfNormal() {
+        return isNonEmptyOfNormal();
+    }
+
     /**
      * 深层实体判断属性
      *
      * @return true 不为空
      */
-    public boolean nonEmptyOfEntity() {
+    public boolean isNonEmptyOfEntity() {
         T entity = getEntity();
         if (entity == null) {
             return false;
@@ -136,6 +146,11 @@ public abstract class Wrapper<T> implements ISqlSegment {
         return StringUtils.isNotBlank(tableInfo.getKeyProperty()) ? Objects.nonNull(tableInfo.getPropertyValue(entity, tableInfo.getKeyProperty())) : false;
     }
 
+    @Deprecated
+    public boolean nonEmptyOfEntity() {
+        return isNonEmptyOfEntity();
+    }
+
     /**
      * 根据实体FieldStrategy属性来决定判断逻辑
      */
@@ -160,7 +175,7 @@ public abstract class Wrapper<T> implements ISqlSegment {
      * @return true 为空
      */
     public boolean isEmptyOfEntity() {
-        return !nonEmptyOfEntity();
+        return !isNonEmptyOfEntity();
     }
 
     /**

+ 1 - 1
mybatis-plus-core/src/main/java/com/baomidou/mybatisplus/core/toolkit/Wrappers.java

@@ -211,7 +211,7 @@ public final class Wrappers {
         }
 
         @Override
-        public boolean nonEmptyOfEntity() {
+        public boolean isNonEmptyOfEntity() {
             return !isEmptyOfEntity();
         }