@Entity public class Window { @Id private int winNo; @ManyToOne private House aHouse; } @Entity public class House { @Id private int houseNo; @OneToMany(mappedBy="aHouse") private List<Window> windows; }
public class Window {
@Id
private int winNo;
@ManyToOne
private House aHouse;
}
@Entity
public class House {
private int houseNo;
@OneToMany(mappedBy="aHouse")
private List<Window> windows;
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.