code: private static Object toQuery(Object obj) throws PageException {
  	if (obj instanceof Struct) {
  	    Struct sct = (Struct) obj;
  	    Key[] keys = CollectionUtil.keys(sct);
  
  	    // Columns
  	    Key[] columns = null;
  	    if (contains(keys, KeyConstants._COLUMNS)) columns = toColumns(sct.get(KeyConstants._COLUMNS, null));
  	    else if (contains(keys, KeyConstants._COLUMNLIST)) columns = toColumnlist(sct.get(KeyConstants._COLUMNLIST, null));
  
  	    // rowcount
  	    int rowcount = -1;
  	    if (contains(keys, ROWCOUNT)) rowcount = toRowCount(sct.get(ROWCOUNT, null));
  	    else if (contains(keys, KeyConstants._RECORDCOUNT)) rowcount = toRowCount(sct.get(KeyConstants._RECORDCOUNT, null));
  
  	    if (columns != null) {
  		if (keys.length == 2 && contains(keys, KeyConstants._DATA)) {
  
  		    Array[] data = toData(sct.get(KeyConstants._DATA, null), columns);
  		    if (data != null) {
  			return new QueryImpl(columns, data, "query");
  		    }
  		}
  
  		else if (keys.length == 3 && rowcount != -1 && contains(keys, KeyConstants._DATA)) {
  		    Array[] data = toData(sct.get(KeyConstants._DATA, null), columns, rowcount);
  		    if (data != null) {
  			return new QueryImpl(columns, data, "query");
  		    }
  		}
  	    }
  	    return toQuery(sct, keys);
  	}
  	/*
  	 * else if(obj instanceof Query) { return toQuery((Query) obj); }
  	 */
  	else if (obj instanceof Collection) {
  	    Collection coll = (Collection) obj;
  	    return toQuery(coll, CollectionUtil.keys(coll));
  	}
  
  	return obj;
  
      }
docs: {"ROWCOUNT":2,"COLUMNS":["AAA","BBB"],"DATA":{"aaa":["a","c"],"bbb":["b","d"]}}