8
JPA @OneToManyアソシエーションを使用する場合の@JoinColumnとmappedByの違いは何ですか
違いは何ですか: @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