Skip to content

[pull] master from Tencent:master #302

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ public AbstractObjectParser parse(String name, boolean isReuse) throws Exception
}
else if (value instanceof JSONObject) { // JSONObject,往下一级提取
if (childMap != null) { // 添加到childMap,最后再解析
childMap.put(key, (JSONObject)value);
childMap.put(key, (JSONObject) value);
}
else { // 直接解析并替换原来的,[]:{} 内必须直接解析,否则会因为丢掉count等属性,并且total@:"/[]/total"必须在[]:{} 后!
JSON cache = index <= 0 || type != TYPE_ITEM || viceItem == null ? null : viceItem.getJSONObject(key);
Expand Down Expand Up @@ -457,10 +457,10 @@ else if (value instanceof String) { // //key{}@ getRealKey, 引用赋值路径
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;");
// FIXME getCache() != null 时 return true,解决 RIGHT/OUTER/FOREIGN JOIN 主表无数据导致副表数据也不返回
return false; // 获取不到就不用再做无效的 query 了。不考虑 Table:{Table:{}} 嵌套
}


Log.d(TAG, "onParse isTable(table) == false >> return true;");
return true; // 舍去,对Table无影响
}
Expand Down
3 changes: 2 additions & 1 deletion APIJSONORM/src/main/java/apijson/orm/AbstractParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -1734,7 +1734,7 @@ else if (join != null){
throw new IllegalArgumentException(e.getKey() + ":'/targetTable:targetAlias/targetKey' 中 targetAlias 值 " + targetAlias + " 不合法!必须满足英文单词变量名格式!");
}

targetTable = targetTableKey; // 主表允许别名
//targetTable = targetTableKey; // 主表允许别名
if (StringUtil.isName(targetTable) == false) {
throw new IllegalArgumentException(e.getKey() + ":'/targetTable/targetKey' 中 targetTable 值 " + targetTable + " 不合法!必须满足大写字母开头的表对象英文单词 key 格式!");
}
Expand All @@ -1760,6 +1760,7 @@ else if (join != null){

on.setOriginKey(originKey);
on.setOriginValue((String) refEntry.getValue());
on.setTargetTableKey(targetTableKey);
on.setTargetTable(targetTable);
on.setTargetAlias(targetAlias);
on.setTargetKey(targetKey);
Expand Down
Loading