스프링부트 with JPA 블로그

스프링부트 with JPA 블로그 18강 - 특강 무한 참조 방지하기

GetInThere 2020. 7. 28. 00:29

(1) Entity로 받고 Json직렬화 하기 전에 DTO 생성후 복사하기

BeanUtils.copyProperties(A,B) 

(2) 처음부터 DTO로 DB에서 받기

(3) @JsonIgnore

(4) @JsonIgnoreProperties({"board"})

(5) @JsonBackReference @JsonManagedReference