@Entity(name = "EmployerInfo")
public static class EmployerInfo {
@Id
private int id;
@MapsId
@OneToOne(optional = false, fetch = FetchType.LAZY)
@LazyToOne(LazyToOneOption.NO_PROXY)
private Employer employer;
}
@Entity(name = "Employer")
public static class Employer {
@Id
private int id;
@OneToOne(optional = false, mappedBy = "employer", cascade = CascadeType.ALL)
@LazyToOne(LazyToOneOption.NO_PROXY)
private EmployerInfo employerInfo;
private String name;
}