영속성 전이 :CASCADE
·
JPA
특정 엔티티를 영속 상태로 만들 때 연관된 엔티티도 함께 연속성상태로 만들고 싶을 때 부모 엔티티르 저장할 때 자식 엔티티도 함께 저장 연관관계, 지연로딩 전혀 관계가 없음 @Entity public class Parent { @Id @GeneratedValue private Long id; private String name; @OneToMany(mappedBy = "parent", cascade = CascadeType.ALL) private List children = new ArrayList(); public void addChild(Child child){ children.add(child); child.setParent(this); } } @Entity public class Child { @..