There is a cycle in the hierarchy!
List<Resource>res=resourceService.findAll();JSONArraydatalist=JSONArray.fromObject(re...
List<Resource> res = resourceService.findAll();
JSONArray datalist = JSONArray.fromObject(res);//这里报错there is a cycle in the hierarchy
用网上提供的方法不好使
下面是Resource属性
private Integer id;
private String title;
private String description;
private Set<Role> roles = new HashSet<Role>();
Resource和Role有多对多的关系
Role的属性
private Integer id;
private String roleName;
private Set<Resource> res = new HashSet<Resource>(); 展开
JSONArray datalist = JSONArray.fromObject(res);//这里报错there is a cycle in the hierarchy
用网上提供的方法不好使
下面是Resource属性
private Integer id;
private String title;
private String description;
private Set<Role> roles = new HashSet<Role>();
Resource和Role有多对多的关系
Role的属性
private Integer id;
private String roleName;
private Set<Resource> res = new HashSet<Resource>(); 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询