1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package net.sf.imca.model.entities;
17
18 import javax.persistence.Entity;
19 import javax.persistence.GeneratedValue;
20 import javax.persistence.GenerationType;
21 import javax.persistence.Id;
22 import javax.persistence.NamedQueries;
23 import javax.persistence.NamedQuery;
24 import javax.persistence.OneToOne;
25
26
27
28
29
30
31
32
33 @Entity
34 @NamedQueries( {
35 @NamedQuery(name = "EventEntryBasicSearch",
36 query = "SELECT o FROM EventEntryEntity o WHERE " +
37 "o.boatName LIKE :search OR o.sailNumber " +
38 "LIKE :search")
39 })
40 public class EventEntryEntity {
41
42
43
44
45 @Id
46 @GeneratedValue(strategy=GenerationType.TABLE)
47 private long id;
48
49 @OneToOne
50 private BoatEntity boat;
51
52 private String sailNumber = "";
53
54 private String boatName = "";
55
56 @OneToOne
57 private EventEntity event;
58
59 @OneToOne
60 private BoatVersionEntity boatVersion;
61
62 @OneToOne
63 private SailingClubEntity sailingClub;
64
65 @OneToOne
66 private PersonEntity person;
67
68 @OneToOne
69 private FeeEntity fee;
70
71 public BoatEntity getBoat() {
72 return boat;
73 }
74
75 public void setBoat(BoatEntity boat) {
76 this.boat = boat;
77 }
78
79 public String getBoatName() {
80 return boatName;
81 }
82
83 public void setBoatName(String boatName) {
84 this.boatName = boatName;
85 }
86
87 public FeeEntity getFee() {
88 return fee;
89 }
90
91 public void setFee(FeeEntity fee) {
92 this.fee = fee;
93 }
94
95 public long getId() {
96 return id;
97 }
98
99 public void setId(long id) {
100 this.id = id;
101 }
102
103 public BoatVersionEntity getBoatVersion() {
104 return boatVersion;
105 }
106
107 public void setBoatVersion(BoatVersionEntity boatVersion) {
108 this.boatVersion = boatVersion;
109 }
110
111 public PersonEntity getPerson() {
112 return person;
113 }
114
115 public void setPerson(PersonEntity person) {
116 this.person = person;
117 }
118
119 public SailingClubEntity getSailingClub() {
120 return sailingClub;
121 }
122
123 public void setSailingClub(SailingClubEntity sailingClub) {
124 this.sailingClub = sailingClub;
125 }
126
127 public String getSailNumber() {
128 return sailNumber;
129 }
130
131 public void setSailNumber(String sailNumber) {
132 this.sailNumber = sailNumber;
133 }
134
135 public EventEntity getEvent() {
136 return event;
137 }
138
139 public void setEvent(EventEntity event) {
140 this.event = event;
141 }
142
143
144
145
146
147 public String toString(){
148 return event.toString() + " - "
149 + boat.toString() + " - "
150 + person.toString();
151 }
152
153 }