`

Hibernate中防止在查询是类中对象级联时的死循环

阅读更多

voteSubject= all.GetVoteSubjectById(vsId);//获取对象数据
         JsonConfig jc=new JsonConfig();
            //设置属性不能转换
            jc.setExcludes(new String[]{"不可以转换的属性之一","不可以转换的属性之级联对象的属性"});
            jc.setCycleDetectionStrategy(CycleDetectionStrategy.LENIENT);
         this.root = JSONObject.fromObject(voteSubject,jc);
         System.out.println(root);

分享到:
评论
1 楼 stupider 2016-08-05  

相关推荐

Global site tag (gtag.js) - Google Analytics