1919import java .io .UnsupportedEncodingException ;
2020import java .net .URLDecoder ;
2121import java .net .URLEncoder ;
22+ import java .util .Map ;
2223import java .util .Set ;
2324
2425/**use this class instead of com.alibaba.fastjson.JSONObject, not encode in default cases
@@ -215,38 +216,26 @@ public static boolean isArrayKey(String key) {
215216 * @return
216217 */
217218 public static boolean isTableKey (String key ) {
218- return StringUtil .isBigWord (key );
219+ return StringUtil .isBigName (key );
219220 }
220221 //judge >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
221222
222223
223224 //JSONObject内关键词 key <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
224225
225226 //@key关键字都放这个类 <<<<<<<<<<<<<<<<<<<<<<
226- /**
227- * 角色,拥有对某些数据的某些操作的权限
228- */
229- public static final String KEY_ROLE = "@role" ;
230- /**
231- * 数据库,Table在非默认schema内时需要声明
232- */
233- public static final String KEY_SCHEMA = "@schema" ;
234- /**
235- * 查询的Table字段或SQL函数
236- */
237- public static final String KEY_COLUMN = "@column" ;
238- /**
239- * 分组方式
240- */
241- public static final String KEY_GROUP = "@group" ;
242- /**
243- * 聚合函数条件,一般和@group一起用
244- */
245- public static final String KEY_HAVING = "@having" ;
246- /**
247- * 排序方式
248- */
249- public static final String KEY_ORDER = "@order" ;
227+ public static final String KEY_ROLE = "@role" ; //角色,拥有对某些数据的某些操作的权限
228+ public static final String KEY_CONDITION = "@condition" ; //条件
229+ public static final String KEY_TRY = "@try" ; //尝试,忽略异常
230+ public static final String KEY_DROP = "@drop" ; //丢弃,不返回
231+ public static final String KEY_CORRECT = "@correct" ; //字段校正
232+
233+ public static final String KEY_SCHEMA = "@schema" ; //数据库,Table在非默认schema内时需要声明
234+ public static final String KEY_ABOUT = "@about" ; //关于,返回数据库表的信息,包括表说明和字段说明
235+ public static final String KEY_COLUMN = "@column" ; //查询的Table字段或SQL函数
236+ public static final String KEY_GROUP = "@group" ; //分组方式
237+ public static final String KEY_HAVING = "@having" ; //聚合函数条件,一般和@group一起用
238+ public static final String KEY_ORDER = "@order" ; //排序方式
250239 //@key关键字都放这个类 >>>>>>>>>>>>>>>>>>>>>>
251240
252241
@@ -258,6 +247,35 @@ public JSONObject setRole(String role) {
258247 put (KEY_ROLE , role );
259248 return this ;
260249 }
250+
251+ /**set try, ignore exceptions
252+ * @param tri
253+ * @return this
254+ */
255+ public JSONObject setTry (boolean tri ) {
256+ put (KEY_TRY , tri );
257+ return this ;
258+ }
259+
260+ /**set drop, data dropped will not return
261+ * @param drop
262+ * @return this
263+ */
264+ public JSONObject setDrop (boolean drop ) {
265+ put (KEY_DROP , drop );
266+ return this ;
267+ }
268+
269+ /**set correct, correct keys to target ones
270+ * @param correct Map{originKey, [posibleKeys]}, posibleKey之间用 , 隔开
271+ * @return this
272+ */
273+ public JSONObject setCorrect (Map <String , String > correct ) {
274+ put (KEY_CORRECT , correct );
275+ return this ;
276+ }
277+
278+
261279
262280 /**set schema where table was put
263281 * @param schema
@@ -268,6 +286,15 @@ public JSONObject setSchema(String schema) {
268286 return this ;
269287 }
270288
289+ /**set about
290+ * @param about
291+ * @return this
292+ */
293+ public JSONObject setAbout (boolean about ) {
294+ put (KEY_ABOUT , about );
295+ return this ;
296+ }
297+
271298 /**set keys need to be returned
272299 * @param keys key0, key1, key2 ...
273300 * @return {@link #setColumn(String)}
0 commit comments