//parent class
@OneToOne(mappedBy = "localBeefManagement"
, fetch = FetchType.LAZY
, cascade = {CascadeType.MERGE, CascadeType.PERSIST, CascadeType.REFRESH}
, optional = false)
private CattleBuyInformation cattleBuyInformation;
//child class
@MapsId("localBeefManagementPK")
@OneToOne(fetch = FetchType.LAZY, cascade = {
CascadeType.PERSIST, CascadeType.MERGE
}, optional = false)
@JoinColumns({
@JoinColumn(name = "cattleEntityManagementNumber",referencedColumnName = "entityManagementNumber")
, @JoinColumn(name = "cattleEntityIdentificationNumber", referencedColumnName = "entityIdentificationNumber")
})
private LocalBeefManagement localBeefManagement;
// Embeddable PK 값 (parent)
private String entityManagementNumber;
private String entityIdentificationNumber;
// Embeddable PK 값 (child)
private String cattleEntityManagementNumber;
private String cattleEntityIdentificationNumber;