From b7d1fef19286e30692ff628f78875e130d1583ca Mon Sep 17 00:00:00 2001 From: TommyLemon <1184482681@qq.com> Date: Sun, 24 Jan 2021 02:55:03 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=85=A8=E5=B1=80=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E5=8F=82=E6=95=B0=E7=9A=84=E8=A7=A3=E6=9E=90=E6=80=A7?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/apijson/orm/AbstractObjectParser.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/APIJSONORM/src/main/java/apijson/orm/AbstractObjectParser.java b/APIJSONORM/src/main/java/apijson/orm/AbstractObjectParser.java index f33534d1..8fcd78d8 100755 --- a/APIJSONORM/src/main/java/apijson/orm/AbstractObjectParser.java +++ b/APIJSONORM/src/main/java/apijson/orm/AbstractObjectParser.java @@ -177,7 +177,7 @@ public abstract class AbstractObjectParser implements ObjectParser { functionMap = null;//must init childMap = null;//must init - Set> set = new LinkedHashSet>(request.entrySet()); + Set> set = request.isEmpty() ? null : new LinkedHashSet>(request.entrySet()); if (set != null && set.isEmpty() == false) {//判断换取少几个变量的初始化是否值得? if (isTable) {//非Table下必须保证原有顺序!否则 count,page 会丢, total@:"/[]/total" 会在[]:{}前执行! customMap = new LinkedHashMap(); @@ -261,17 +261,17 @@ public abstract class AbstractObjectParser implements ObjectParser { } if (isTable) { - if (sqlRequest.get(JSONRequest.KEY_DATABASE) == null && parser.getGlobleDatabase() != null) { + if (parser.getGlobleDatabase() != null && sqlRequest.get(JSONRequest.KEY_DATABASE) == null) { sqlRequest.put(JSONRequest.KEY_DATABASE, parser.getGlobleDatabase()); } - if (sqlRequest.get(JSONRequest.KEY_SCHEMA) == null && parser.getGlobleSchema() != null) { + if (parser.getGlobleSchema() != null && sqlRequest.get(JSONRequest.KEY_SCHEMA) == null) { sqlRequest.put(JSONRequest.KEY_SCHEMA, parser.getGlobleSchema()); } if (isSubquery == false) { //解决 SQL 语法报错,子查询不能 EXPLAIN - if (sqlRequest.get(JSONRequest.KEY_EXPLAIN) == null && parser.getGlobleExplain() != null) { + if (parser.getGlobleExplain() != null && sqlRequest.get(JSONRequest.KEY_EXPLAIN) == null) { sqlRequest.put(JSONRequest.KEY_EXPLAIN, parser.getGlobleExplain()); } - if (sqlRequest.get(JSONRequest.KEY_CACHE) == null && parser.getGlobleCache() != null) { + if (parser.getGlobleCache() != null && sqlRequest.get(JSONRequest.KEY_CACHE) == null) { sqlRequest.put(JSONRequest.KEY_CACHE, parser.getGlobleCache()); } }