過濾關聯表屬性

假設你從數據庫查到集合的是userList

JsonConfig jsonConfig = new JsonConfig();

jsonConfig.setIgnoreDefaultExcludes(false);

//設置過濾條件

jsonConfig.setExcludes(new String[]{"user","role"});

//過濾關聯屬性並封裝成Json對象。

JSONObject jGridVo = JSONObject.fromObject(userList,jsonConfig);

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章