1 package myorg.relex.one2one;
2
3 import javax.persistence.*;
4
5
6
7
8
9
10 @Entity
11 @Table(name="RELATIONEX_ATTENDEE")
12 public class Attendee {
13 @Id @GeneratedValue
14 private int id;
15
16
17 @OneToOne(cascade=CascadeType.PERSIST, orphanRemoval=true)
18 private Residence residence;
19
20 private String name;
21
22 public int getId() { return id; }
23
24 public Residence getResidence() { return residence; }
25 public void setResidence(Residence residence) {
26 this.residence = residence;
27 }
28
29 public String getName() { return name; }
30 public void setName(String name) {
31 this.name = name;
32 }
33 }