xautlx / s2jh

A Java/J2EE development framework for enterprise system based on Struts/Spring/JPA/Hibernate and jquery/bootstrap
GNU Lesser General Public License v3.0
321 stars 242 forks source link

部门用户修改后 出现json格式化堆栈溢出. #98

Closed xiaolongyuan closed 9 years ago

xiaolongyuan commented 10 years ago

原因: User 1 部门为 Dept A Dept A 部门的主管为 User 1

如此,循环无限加载到处堆栈溢出

我的办法: 使用@JsonIgone注解是其中一个不被序列化

弊端:部门列表时 主管人不显示

xiaolongyuan commented 9 years ago
 @OneToOne(cascade = CascadeType.DETACH)
 @JoinColumn(name = "USER_ID")