@@ -752,8 +752,6 @@ public JSONArray onArrayParse(JSONObject request, String parentPath, String name
752752 final Integer count = request .getInteger (JSONRequest .KEY_COUNT ); //TODO 如果不想用默认数量可以改成 getIntValue(JSONRequest.KEY_COUNT);
753753 final int page = request .getIntValue (JSONRequest .KEY_PAGE );
754754 final Object join = request .get (JSONRequest .KEY_JOIN );
755- final String cache = request .getString (JSONRequest .KEY_CACHE );
756- final boolean explain = request .getBooleanValue (JSONRequest .KEY_EXPLAIN );
757755
758756 int query2 ;
759757 if (query == null ) {
@@ -778,33 +776,6 @@ public JSONArray onArrayParse(JSONObject request, String parentPath, String name
778776 }
779777 }
780778
781- int cache2 ;
782- if (cache == null ) {
783- cache2 = JSONRequest .CACHE_ALL ;
784- }
785- else {
786- if (isSubquery ) {
787- throw new IllegalArgumentException ("子查询内不支持传 " + JSONRequest .KEY_CACHE + "!" );
788- }
789-
790- switch (cache ) {
791- case "0" :
792- case JSONRequest .CACHE_ALL_STRING :
793- cache2 = JSONRequest .CACHE_ALL ;
794- break ;
795- case "1" :
796- case JSONRequest .CACHE_ROM_STRING :
797- cache2 = JSONRequest .CACHE_ROM ;
798- break ;
799- case "2" :
800- case JSONRequest .CACHE_RAM_STRING :
801- cache2 = JSONRequest .CACHE_RAM ;
802- break ;
803- default :
804- throw new IllegalArgumentException (path + "/" + JSONRequest .KEY_CACHE + ":value 中 value 的值不合法!必须在 [0,1,2] 或 [ALL, ROM, RAM] 内 !" );
805- }
806- }
807-
808779 int maxPage = getMaxQueryPage ();
809780 if (page < 0 || page > maxPage ) {
810781 throw new IllegalArgumentException (path + "/" + JSONRequest .KEY_PAGE + ":value 中 value 的值不合法!必须在 0-" + maxPage + " 内 !" );
@@ -822,9 +793,7 @@ public JSONArray onArrayParse(JSONObject request, String parentPath, String name
822793 request .remove (JSONRequest .KEY_COUNT );
823794 request .remove (JSONRequest .KEY_PAGE );
824795 request .remove (JSONRequest .KEY_JOIN );
825- request .remove (JSONRequest .KEY_CACHE );
826- request .remove (JSONRequest .KEY_EXPLAIN );
827- Log .d (TAG , "onArrayParse query = " + query + "; count = " + count + "; page = " + page + "; join = " + join + "; cache = " + cache + "; explain = " + explain );
796+ Log .d (TAG , "onArrayParse query = " + query + "; count = " + count + "; page = " + page + "; join = " + join );
828797
829798 if (request .isEmpty ()) {//如果条件成立,说明所有的 parentPath/name:request 中request都无效!!!
830799 Log .e (TAG , "onArrayParse request.isEmpty() >> return null;" );
@@ -854,20 +823,15 @@ public JSONArray onArrayParse(JSONObject request, String parentPath, String name
854823 .setCount (size )
855824 .setPage (page )
856825 .setQuery (query2 )
857- .setCache (cache2 )
858- .setExplain (explain )
859826 .setJoinList (onJoinParse (join , request ));
860827
861- int len = explain || isSubquery ? 1 : size ;
862828 JSONObject parent ;
863- for (int i = 0 ; i < len ; i ++) { //生成len个, config.setType(SQLConfig.TYPE_ITEM) 每次都必要,因为内部会设置成其它值
829+ //生成size个
830+ for (int i = 0 ; i < (isSubquery ? 1 : size ); i ++) {
864831 parent = onObjectParse (request , path , "" + i , config .setType (SQLConfig .TYPE_ITEM ).setPosition (i ), isSubquery );
865832 if (parent == null || parent .isEmpty ()) {
866833 break ;
867834 }
868- if (explain ) {
869- parent .put (JSONRequest .KEY_EXPLAIN , explain );
870- }
871835 //key[]:{Table:{}}中key equals Table时 提取Table
872836 response .add (getValue (parent , childKeys )); //null有意义
873837 }
@@ -900,8 +864,6 @@ public JSONArray onArrayParse(JSONObject request, String parentPath, String name
900864 request .put (JSONRequest .KEY_COUNT , count );
901865 request .put (JSONRequest .KEY_PAGE , page );
902866 request .put (JSONRequest .KEY_JOIN , join );
903- request .put (JSONRequest .KEY_CACHE , cache );
904- request .put (JSONRequest .KEY_EXPLAIN , explain );
905867
906868 if (Log .DEBUG ) {
907869 Log .i (TAG , "onArrayParse return response = \n " + JSON .toJSONString (response ) + "\n >>>>>>>>>>>>>>>\n \n \n " );
0 commit comments