Skip to content

Commit 83e8780

Browse files
committed
解决引用赋值取不到有效值,直接忽略条件仍然执行查询
1 parent 0852e88 commit 83e8780

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

APIJSONORM/src/main/java/apijson/orm/AbstractObjectParser.java

+9-1
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,15 @@ else if (value instanceof String) { // //key{}@ getRealKey, 引用赋值路径
423423

424424
if (target == null) { // String#equals(null)会出错
425425
Log.d(TAG, "onParse target == null >> return true;");
426-
return true;
426+
// 非查询关键词 @key 不影响查询,直接跳过
427+
if (isTable && (key.startsWith("@") == false || JSONRequest.TABLE_KEY_LIST.contains(key))) {
428+
Log.e(TAG, "onParse isTable && (key.startsWith(@) == false"
429+
+ " || JSONRequest.TABLE_KEY_LIST.contains(key)) >> return null;");
430+
return false; // 获取不到就不用再做无效的 query 了。不考虑 Table:{Table:{}} 嵌套
431+
}
432+
433+
Log.d(TAG, "onParse isTable(table) == false >> return true;");
434+
return true; // 舍去,对Table无影响
427435
}
428436

429437
// if (target instanceof Map) { // target 可能是从 requestObject 里取出的 {}

0 commit comments

Comments
 (0)