@@ -71,7 +71,7 @@ public AbstractObjectParser setParser(AbstractParser<?> parser) {
7171 * @param parentPath
7272 * @param request
7373 * @param name
74- * @throws Exception
74+ * @throws Exception
7575 */
7676 public AbstractObjectParser (@ NotNull JSONObject request , String parentPath , SQLConfig arrayConfig
7777 , boolean isSubquery , boolean isTable , boolean isArrayMainTable ) throws Exception {
@@ -400,7 +400,7 @@ public boolean onParse(@NotNull String key, @NotNull Object value) throws Except
400400 if (arrObj == null ) {
401401 throw new IllegalArgumentException ("子查询 " + path + "/" + key + ":{ from:value } 中 value 对应的主表对象 " + from + ":{} 不存在!" );
402402 }
403- //
403+ //
404404 SQLConfig cfg = (SQLConfig ) arrObj .get (AbstractParser .KEY_CONFIG );
405405 if (cfg == null ) {
406406 throw new NotExistException (TAG + ".onParse cfg == null" );
@@ -453,7 +453,7 @@ else if (value instanceof String) { // //key{}@ getRealKey, 引用赋值路径
453453 Log .d (TAG , "onParse isTable(table) == false >> return true;" );
454454 return true ;//舍去,对Table无影响
455455 }
456- }
456+ }
457457
458458 //直接替换原来的key@:path为key:target
459459 Log .i (TAG , "onParse >> key = replaceKey; value = target;" );
@@ -517,7 +517,7 @@ else if (isTable && key.startsWith("@") && JSONRequest.TABLE_KEY_LIST.contains(k
517517 /**
518518 * @param key
519519 * @param value
520- * @param isFirst
520+ * @param isFirst
521521 * @return
522522 * @throws Exception
523523 */
@@ -553,7 +553,7 @@ public JSON onChildParse(int index, String key, JSONObject value) throws Excepti
553553 + "数组 []:{} 中每个 key:{} 都必须是表 TableKey:{} 或 数组 arrayKey[]:{} !" );
554554 }
555555
556- if ( //避免使用 "test":{"Test":{}} 绕过限制,实现查询爆炸 isTableKey &&
556+ if ( //避免使用 "test":{"Test":{}} 绕过限制,实现查询爆炸 isTableKey &&
557557 (arrayConfig == null || arrayConfig .getPosition () == 0 )) {
558558 objectCount ++;
559559 int maxObjectCount = parser .getMaxObjectCount ();
@@ -577,7 +577,7 @@ public JSON onChildParse(int index, String key, JSONObject value) throws Excepti
577577
578578
579579
580- //TODO 改用 MySQL json_add,json_remove,json_contains 等函数!
580+ //TODO 改用 MySQL json_add,json_remove,json_contains 等函数!
581581 /**PUT key:[]
582582 * @param key
583583 * @param array
@@ -757,7 +757,7 @@ public AbstractObjectParser executeSQL() throws Exception {
757757 //执行SQL操作数据库
758758 if (isTable == false ) {//提高性能
759759 sqlReponse = new JSONObject (sqlRequest );
760- }
760+ }
761761 else {
762762 try {
763763 sqlReponse = onSQLExecute ();
@@ -896,7 +896,8 @@ public JSONObject onSQLExecute() throws Exception {
896896 result = parser .executeSQL (sqlConfig , isSubquery );
897897
898898 boolean isSimpleArray = false ;
899- List <JSONObject > rawList = null ;
899+ // 提取并缓存数组主表的列表数据
900+ List <JSONObject > rawList = (List <JSONObject >) result .remove (AbstractSQLExecutor .KEY_RAW_LIST );
900901
901902 if (isArrayMainTable && position == 0 && result != null ) {
902903
@@ -905,8 +906,7 @@ public JSONObject onSQLExecute() throws Exception {
905906 && (childMap == null || childMap .isEmpty ())
906907 && (table .equals (arrayTable ));
907908
908- // 提取并缓存数组主表的列表数据
909- rawList = (List <JSONObject >) result .remove (AbstractSQLExecutor .KEY_RAW_LIST );
909+ // APP JOIN 副表时副表返回了这个字段 rawList = (List<JSONObject>) result.remove(AbstractSQLExecutor.KEY_RAW_LIST);
910910 if (rawList != null ) {
911911 String arrayPath = parentPath .substring (0 , parentPath .lastIndexOf ("[]" ) + 2 );
912912
0 commit comments