소스 검색

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

Caratacus 6 년 전
부모
커밋
d781b10b56
1개의 변경된 파일1개의 추가작업 그리고 3개의 파일을 삭제
  1. 1 3
      mybatis-plus-core/src/main/java/com/baomidou/mybatisplus/core/conditions/Wrapper.java

+ 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));
-
     }
 
     /**