JSONArray 报错: NoSuchMethodException: Property 'delegate' has no getter method

   当咱们配置完OpenSessionInViewFilter,或者把转换对象为json字串的操做放到了事务里面之后,仍然报错 :java.lang.NoSuchMethodException: Property 'delegate' has no getter method  .java

一种解决方案:json


JsonConfig config = new JsonConfig();ide

config.setExcludes(new String[]{"one2many的字段集合名称", "hibernateLazyInitializer","handler","tProvince"});spa

JSONArray jsonArray = JSONArray.fromObject(dao.getAll(rowStartIdxAndCount),config);hibernate

return jsonArray.toString();对象

相关文章
相关标签/搜索