Skip to content

Commit

Permalink
解决引用赋值取不到有效值,直接忽略条件仍然执行查询
Browse files Browse the repository at this point in the history
  • Loading branch information
TommyLemon committed Sep 3, 2023
1 parent 0852e88 commit 83e8780
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion APIJSONORM/src/main/java/apijson/orm/AbstractObjectParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,15 @@ else if (value instanceof String) { // //key{}@ getRealKey, 引用赋值路径

if (target == null) { // String#equals(null)会出错
Log.d(TAG, "onParse target == null >> return true;");
return true;
// 非查询关键词 @key 不影响查询,直接跳过
if (isTable && (key.startsWith("@") == false || JSONRequest.TABLE_KEY_LIST.contains(key))) {
Log.e(TAG, "onParse isTable && (key.startsWith(@) == false"
+ " || JSONRequest.TABLE_KEY_LIST.contains(key)) >> return null;");
return false; // 获取不到就不用再做无效的 query 了。不考虑 Table:{Table:{}} 嵌套
}

Log.d(TAG, "onParse isTable(table) == false >> return true;");
return true; // 舍去,对Table无影响
}

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

0 comments on commit 83e8780

Please sign in to comment.