1
2
3
4
5
6 package fr.ifremer.quadrige2.core.dao.referential;
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29 import fr.ifremer.quadrige2.core.dao.sandre.SandreAnalysisInstrumentExp;
30 import fr.ifremer.quadrige2.core.dao.sandre.SandreAnalysisInstrumentImp;
31 import java.io.Serializable;
32 import java.sql.Timestamp;
33 import java.util.Collection;
34 import java.util.HashSet;
35
36
37
38
39
40 public abstract class AnalysisInstrument
41 implements Serializable, Comparable<AnalysisInstrument>
42 {
43
44
45
46 private static final long serialVersionUID = 715685291693032509L;
47
48
49 private Integer analInstId;
50
51
52
53
54
55 public Integer getAnalInstId()
56 {
57 return this.analInstId;
58 }
59
60
61
62
63
64 public void setAnalInstId(Integer analInstIdIn)
65 {
66 this.analInstId = analInstIdIn;
67 }
68
69 private String analInstNm;
70
71
72
73
74
75 public String getAnalInstNm()
76 {
77 return this.analInstNm;
78 }
79
80
81
82
83
84 public void setAnalInstNm(String analInstNmIn)
85 {
86 this.analInstNm = analInstNmIn;
87 }
88
89 private String analInstDc;
90
91
92
93
94
95 public String getAnalInstDc()
96 {
97 return this.analInstDc;
98 }
99
100
101
102
103
104 public void setAnalInstDc(String analInstDcIn)
105 {
106 this.analInstDc = analInstDcIn;
107 }
108
109 private Timestamp updateDt;
110
111
112
113
114
115 public Timestamp getUpdateDt()
116 {
117 return this.updateDt;
118 }
119
120
121
122
123
124 public void setUpdateDt(Timestamp updateDtIn)
125 {
126 this.updateDt = updateDtIn;
127 }
128
129
130 private Collection<SandreAnalysisInstrumentImp> sandreAnalysisInstrumentImpIds = new HashSet<SandreAnalysisInstrumentImp>();
131
132
133
134
135
136 public Collection<SandreAnalysisInstrumentImp> getSandreAnalysisInstrumentImpIds()
137 {
138 return this.sandreAnalysisInstrumentImpIds;
139 }
140
141
142
143
144
145 public void setSandreAnalysisInstrumentImpIds(Collection<SandreAnalysisInstrumentImp> sandreAnalysisInstrumentImpIdsIn)
146 {
147 this.sandreAnalysisInstrumentImpIds = sandreAnalysisInstrumentImpIdsIn;
148 }
149
150
151
152
153
154
155
156 public boolean addSandreAnalysisInstrumentImpIds(SandreAnalysisInstrumentImp elementToAdd)
157 {
158 return this.sandreAnalysisInstrumentImpIds.add(elementToAdd);
159 }
160
161
162
163
164
165
166
167 public boolean removeSandreAnalysisInstrumentImpIds(SandreAnalysisInstrumentImp elementToRemove)
168 {
169 return this.sandreAnalysisInstrumentImpIds.remove(elementToRemove);
170 }
171
172 private Status status;
173
174
175
176
177
178 public Status getStatus()
179 {
180 return this.status;
181 }
182
183
184
185
186
187 public void setStatus(Status statusIn)
188 {
189 this.status = statusIn;
190 }
191
192 private Collection<SandreAnalysisInstrumentExp> sandreAnalysisInstrumentExpIds = new HashSet<SandreAnalysisInstrumentExp>();
193
194
195
196
197
198 public Collection<SandreAnalysisInstrumentExp> getSandreAnalysisInstrumentExpIds()
199 {
200 return this.sandreAnalysisInstrumentExpIds;
201 }
202
203
204
205
206
207 public void setSandreAnalysisInstrumentExpIds(Collection<SandreAnalysisInstrumentExp> sandreAnalysisInstrumentExpIdsIn)
208 {
209 this.sandreAnalysisInstrumentExpIds = sandreAnalysisInstrumentExpIdsIn;
210 }
211
212
213
214
215
216
217
218 public boolean addSandreAnalysisInstrumentExpIds(SandreAnalysisInstrumentExp elementToAdd)
219 {
220 return this.sandreAnalysisInstrumentExpIds.add(elementToAdd);
221 }
222
223
224
225
226
227
228
229 public boolean removeSandreAnalysisInstrumentExpIds(SandreAnalysisInstrumentExp elementToRemove)
230 {
231 return this.sandreAnalysisInstrumentExpIds.remove(elementToRemove);
232 }
233
234
235
236
237
238 @Override
239 public boolean equals(Object object)
240 {
241 if (this == object)
242 {
243 return true;
244 }
245 if (!(object instanceof AnalysisInstrument))
246 {
247 return false;
248 }
249 final AnalysisInstrument that = (AnalysisInstrument)object;
250 if (this.analInstId == null || that.getAnalInstId() == null || !this.analInstId.equals(that.getAnalInstId()))
251 {
252 return false;
253 }
254 return true;
255 }
256
257
258
259
260 @Override
261 public int hashCode()
262 {
263 int hashCode = 0;
264 hashCode = 29 * hashCode + (this.analInstId == null ? 0 : this.analInstId.hashCode());
265
266 return hashCode;
267 }
268
269
270
271
272 public static final class Factory
273 {
274
275
276
277
278 public static AnalysisInstrument newInstance()
279 {
280 return new AnalysisInstrumentImpl();
281 }
282
283
284
285
286
287
288
289
290
291 public static AnalysisInstrument newInstance(String analInstNm, Timestamp updateDt, Status status)
292 {
293 final AnalysisInstrument entity = new AnalysisInstrumentImpl();
294 entity.setAnalInstNm(analInstNm);
295 entity.setUpdateDt(updateDt);
296 entity.setStatus(status);
297 return entity;
298 }
299
300
301
302
303
304
305
306
307
308
309
310
311 public static AnalysisInstrument newInstance(String analInstNm, String analInstDc, Timestamp updateDt, Collection<SandreAnalysisInstrumentImp> sandreAnalysisInstrumentImpIds, Status status, Collection<SandreAnalysisInstrumentExp> sandreAnalysisInstrumentExpIds)
312 {
313 final AnalysisInstrument entity = new AnalysisInstrumentImpl();
314 entity.setAnalInstNm(analInstNm);
315 entity.setAnalInstDc(analInstDc);
316 entity.setUpdateDt(updateDt);
317 entity.setSandreAnalysisInstrumentImpIds(sandreAnalysisInstrumentImpIds);
318 entity.setStatus(status);
319 entity.setSandreAnalysisInstrumentExpIds(sandreAnalysisInstrumentExpIds);
320 return entity;
321 }
322 }
323
324
325
326
327 public int compareTo(AnalysisInstrument o)
328 {
329 int cmp = 0;
330 if (this.getAnalInstId() != null)
331 {
332 cmp = this.getAnalInstId().compareTo(o.getAnalInstId());
333 }
334 else
335 {
336 if (this.getAnalInstNm() != null)
337 {
338 cmp = (cmp != 0 ? cmp : this.getAnalInstNm().compareTo(o.getAnalInstNm()));
339 }
340 if (this.getAnalInstDc() != null)
341 {
342 cmp = (cmp != 0 ? cmp : this.getAnalInstDc().compareTo(o.getAnalInstDc()));
343 }
344 if (this.getUpdateDt() != null)
345 {
346 cmp = (cmp != 0 ? cmp : this.getUpdateDt().compareTo(o.getUpdateDt()));
347 }
348 }
349 return cmp;
350 }
351
352
353 }