@Entity public class Yard { @Id private int yardNo; @OneToOne(mappedBy="backYard") private House aHouse; } @Entity public class House { @Id private int houseNo; @OneToOne private Yard backYard; }
public class Yard {
@Id
private int yardNo;
@OneToOne(mappedBy="backYard")
private House aHouse;
}
@Entity
public class House {
private int houseNo;
@OneToOne
private Yard backYard;
Java Persistence API
Access: Public Instant Grading
Jobilize.com uses cookies to ensure that you get the best experience. By continuing to use Jobilize.com web-site, you agree to the Terms of Use.