Browse Source

根据字段策略来判断实体是否真正为空

Caratacus 6 years ago
parent
commit
d781b10b56

+ 1 - 3
mybatis-plus-core/src/main/java/com/baomidou/mybatisplus/core/conditions/Wrapper.java

@@ -101,10 +101,8 @@ public abstract class Wrapper<T> implements ISqlSegment {
      */
     public boolean nonEmptyOfEntity() {
         T entity = getEntity();
-        Class<?> entityClass = entity.getClass();
-        TableInfo tableInfo = TableInfoHelper.getTableInfo(entityClass);
+        TableInfo tableInfo = TableInfoHelper.getTableInfo(entity.getClass());
         return Objects.nonNull(getEntity()) && tableInfo.getFieldList().stream().anyMatch(e -> fieldStrategyMatch(entity, tableInfo, e, true));
-
     }
 
     /**