Skip to content

Commit dbe28f4

Browse files
committed
引用赋值:解决从数组外部引用该数组内值只能拿到第 0 个(且路径也不友好)
1 parent 5ea9139 commit dbe28f4

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1171,7 +1171,9 @@ else if (isArrayMainTable && position > 0) { // 数组主表使用专门的缓
11711171
// APP JOIN 副表时副表返回了这个字段 rawList = (List<JSONRequest>) result.remove(AbstractSQLExecutor.KEY_RAW_LIST);
11721172
String arrayPath = parentPath.substring(0, parentPath.lastIndexOf("[]") + 2);
11731173

1174-
if (isSimpleArray == false) {
1174+
if (isSimpleArray) {
1175+
parser.putQueryResult(arrayPath, rawList); // 从数组外部引用该数组内值需要
1176+
} else {
11751177
long startTime = System.currentTimeMillis();
11761178

11771179
for (int i = 1; i < rawList.size(); i++) { // 从 1 开始,0 已经处理过
@@ -1196,7 +1198,7 @@ else if (isArrayMainTable && position > 0) { // 数组主表使用专门的缓
11961198
if (isSubquery == false && result != null) {
11971199
parser.putQueryResult(path, result); // 解决获取关联数据时requestObject里不存在需要的关联数据
11981200

1199-
if (isSimpleArray && rawList != null) {
1201+
if (isSimpleArray) { // FIXME 改为从缓存获取,而不是 result 查
12001202
result.put(AbstractSQLExecutor.KEY_RAW_LIST, rawList);
12011203
}
12021204
}

0 commit comments

Comments
 (0)