1 package myorg.relex.one2one;
2
3 import java.util.Date;
4
5 import javax.persistence.*;
6
7
8
9
10
11 @Entity
12 @Table(name="RELATIONEX_APPLICATION")
13 public class Application {
14 @Id
15 private int id;
16 @MapsId
17 @OneToOne(
18 optional=false, fetch=FetchType.EAGER)
19 private Applicant applicant;
20
21 @Temporal(TemporalType.DATE)
22 private Date desiredStartDate;
23
24 protected Application() {}
25 public Application(Applicant applicant) {
26 this.applicant = applicant;
27 if (applicant != null) {
28 applicant.setApplication(this);
29 }
30 }
31
32 public int getId() { return id; }
33 public Applicant getApplicant() { return applicant; }
34
35 public Date getDesiredStartDate() { return desiredStartDate; }
36 public void setDesiredStartDate(Date desiredStartDate) {
37 this.desiredStartDate = desiredStartDate;
38 }
39 }