JPA CascadeType
-
Spring JPA CascadeType 종류Engineering WIKI/Docs 2022. 4. 2. 01:35
Spring JPA CascadeType 종류 javax.persistence.CascadeType JPA Cascade Type ALL PERSIST MERGE REMOVE REFRESH DETACH CascadeType.ALL 상위 엔터티에서 하위 엔터티로 모든 작업을 전파 @Entity public class Person { @Id @GeneratedValue(strategy = GenerationType.AUTO) private int id; private String name; @OneToMany(mappedBy = "person", cascade = CascadeType.ALL) private List addresses; } @Entity public class Address { @Id @Ge..