8
JPA @OneToMany 연관 사용시 @JoinColumn과 MappingBy의 차이점
차이점은 무엇입니까? @Entity public class Company { @OneToMany(cascade = CascadeType.ALL , fetch = FetchType.LAZY) @JoinColumn(name = "companyIdRef", referencedColumnName = "companyId") private List<Branch> branches; ... } 과 @Entity public class Company { @OneToMany(cascade = CascadeType.ALL , fetch = FetchType.LAZY, mappedBy = "companyIdRef") private List<Branch> branches; ... }
516
java
hibernate
jpa
orm
one-to-many