Browse Source

优化查询逻辑

zhouhao 6 years ago
parent
commit
c391e51dbc

+ 1 - 1
hsweb-commons/hsweb-commons-service/hsweb-commons-service-simple/src/main/java/org/hswebframework/web/service/DefaultQueryByEntityService.java

@@ -60,7 +60,7 @@ public interface DefaultQueryByEntityService<E>
             if (param instanceof QueryParamEntity) {
                 ((QueryParamEntity) param).rePaging(total);
             }
-            pagerResult.setData(getDao().query(param));
+            pagerResult.setData(select(param));
         }
         return pagerResult;
     }

+ 1 - 1
hsweb-commons/hsweb-commons-service/hsweb-commons-service-simple/src/main/java/org/hswebframework/web/service/GenericEntityService.java

@@ -61,7 +61,7 @@ public abstract class GenericEntityService<E extends GenericEntity<PK>, PK>
 
     @PostConstruct
     public void init() {
-        if (null != logicPrimaryKeyValidator && logicPrimaryKeyValidator instanceof DefaultLogicPrimaryKeyValidator) {
+        if (logicPrimaryKeyValidator instanceof DefaultLogicPrimaryKeyValidator) {
             DefaultLogicPrimaryKeyValidator.registerQuerySuppiler(getEntityInstanceType(), bean -> this.createQuery().not("id", bean.getId()));
         }
     }