1
2
3
4
5
6 package fr.ifremer.quadrige2.core.dao.administration.metaprogamme;
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.administration.program.Program;
30 import fr.ifremer.quadrige2.core.dao.administration.user.Department;
31 import fr.ifremer.quadrige2.core.dao.administration.user.Quser;
32 import java.io.Serializable;
33 import java.sql.Timestamp;
34 import java.util.Collection;
35 import java.util.HashSet;
36
37
38
39
40
41 public abstract class Metaprogramme
42 implements Serializable, Comparable<Metaprogramme>
43 {
44
45
46
47 private static final long serialVersionUID = 442571845093938316L;
48
49
50 private String metCd;
51
52
53
54
55
56 public String getMetCd()
57 {
58 return this.metCd;
59 }
60
61
62
63
64
65 public void setMetCd(String metCdIn)
66 {
67 this.metCd = metCdIn;
68 }
69
70 private String metNm;
71
72
73
74
75
76 public String getMetNm()
77 {
78 return this.metNm;
79 }
80
81
82
83
84
85 public void setMetNm(String metNmIn)
86 {
87 this.metNm = metNmIn;
88 }
89
90 private String metDc;
91
92
93
94
95
96 public String getMetDc()
97 {
98 return this.metDc;
99 }
100
101
102
103
104
105 public void setMetDc(String metDcIn)
106 {
107 this.metDc = metDcIn;
108 }
109
110 private Timestamp updateDt;
111
112
113
114
115
116 public Timestamp getUpdateDt()
117 {
118 return this.updateDt;
119 }
120
121
122
123
124
125 public void setUpdateDt(Timestamp updateDtIn)
126 {
127 this.updateDt = updateDtIn;
128 }
129
130
131 private Collection<Program> programs = new HashSet<Program>();
132
133
134
135
136
137 public Collection<Program> getPrograms()
138 {
139 return this.programs;
140 }
141
142
143
144
145
146 public void setPrograms(Collection<Program> programsIn)
147 {
148 this.programs = programsIn;
149 }
150
151
152
153
154
155
156
157 public boolean addPrograms(Program elementToAdd)
158 {
159 return this.programs.add(elementToAdd);
160 }
161
162
163
164
165
166
167
168 public boolean removePrograms(Program elementToRemove)
169 {
170 return this.programs.remove(elementToRemove);
171 }
172
173 private Collection<Department> departments = new HashSet<Department>();
174
175
176
177
178
179 public Collection<Department> getDepartments()
180 {
181 return this.departments;
182 }
183
184
185
186
187
188 public void setDepartments(Collection<Department> departmentsIn)
189 {
190 this.departments = departmentsIn;
191 }
192
193
194
195
196
197
198
199 public boolean addDepartments(Department elementToAdd)
200 {
201 return this.departments.add(elementToAdd);
202 }
203
204
205
206
207
208
209
210 public boolean removeDepartments(Department elementToRemove)
211 {
212 return this.departments.remove(elementToRemove);
213 }
214
215 private Collection<Quser> qusers = new HashSet<Quser>();
216
217
218
219
220
221 public Collection<Quser> getQusers()
222 {
223 return this.qusers;
224 }
225
226
227
228
229
230 public void setQusers(Collection<Quser> qusersIn)
231 {
232 this.qusers = qusersIn;
233 }
234
235
236
237
238
239
240
241 public boolean addQusers(Quser elementToAdd)
242 {
243 return this.qusers.add(elementToAdd);
244 }
245
246
247
248
249
250
251
252 public boolean removeQusers(Quser elementToRemove)
253 {
254 return this.qusers.remove(elementToRemove);
255 }
256
257 private Collection<PmfmMet> pmfmMets = new HashSet<PmfmMet>();
258
259
260
261
262
263 public Collection<PmfmMet> getPmfmMets()
264 {
265 return this.pmfmMets;
266 }
267
268
269
270
271
272 public void setPmfmMets(Collection<PmfmMet> pmfmMetsIn)
273 {
274 this.pmfmMets = pmfmMetsIn;
275 }
276
277
278
279
280
281
282
283 public boolean addPmfmMets(PmfmMet elementToAdd)
284 {
285 return this.pmfmMets.add(elementToAdd);
286 }
287
288
289
290
291
292
293
294 public boolean removePmfmMets(PmfmMet elementToRemove)
295 {
296 return this.pmfmMets.remove(elementToRemove);
297 }
298
299 private Collection<MonLocMet> monLocMets = new HashSet<MonLocMet>();
300
301
302
303
304
305 public Collection<MonLocMet> getMonLocMets()
306 {
307 return this.monLocMets;
308 }
309
310
311
312
313
314 public void setMonLocMets(Collection<MonLocMet> monLocMetsIn)
315 {
316 this.monLocMets = monLocMetsIn;
317 }
318
319
320
321
322
323
324
325 public boolean addMonLocMets(MonLocMet elementToAdd)
326 {
327 return this.monLocMets.add(elementToAdd);
328 }
329
330
331
332
333
334
335
336 public boolean removeMonLocMets(MonLocMet elementToRemove)
337 {
338 return this.monLocMets.remove(elementToRemove);
339 }
340
341
342
343
344
345 @Override
346 public boolean equals(Object object)
347 {
348 if (this == object)
349 {
350 return true;
351 }
352 if (!(object instanceof Metaprogramme))
353 {
354 return false;
355 }
356 final Metaprogramme that = (Metaprogramme)object;
357 if (this.metCd == null || that.getMetCd() == null || !this.metCd.equals(that.getMetCd()))
358 {
359 return false;
360 }
361 return true;
362 }
363
364
365
366
367 @Override
368 public int hashCode()
369 {
370 int hashCode = 0;
371 hashCode = 29 * hashCode + (this.metCd == null ? 0 : this.metCd.hashCode());
372
373 return hashCode;
374 }
375
376
377
378
379 public static final class Factory
380 {
381
382
383
384
385 public static Metaprogramme newInstance()
386 {
387 return new MetaprogrammeImpl();
388 }
389
390
391
392
393
394
395
396
397 public static Metaprogramme newInstance(String metNm, Timestamp updateDt)
398 {
399 final Metaprogramme entity = new MetaprogrammeImpl();
400 entity.setMetNm(metNm);
401 entity.setUpdateDt(updateDt);
402 return entity;
403 }
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418 public static Metaprogramme newInstance(String metNm, String metDc, Timestamp updateDt, Collection<Program> programs, Collection<Department> departments, Collection<Quser> qusers, Collection<PmfmMet> pmfmMets, Collection<MonLocMet> monLocMets)
419 {
420 final Metaprogramme entity = new MetaprogrammeImpl();
421 entity.setMetNm(metNm);
422 entity.setMetDc(metDc);
423 entity.setUpdateDt(updateDt);
424 entity.setPrograms(programs);
425 entity.setDepartments(departments);
426 entity.setQusers(qusers);
427 entity.setPmfmMets(pmfmMets);
428 entity.setMonLocMets(monLocMets);
429 return entity;
430 }
431 }
432
433
434
435
436 public int compareTo(Metaprogramme o)
437 {
438 int cmp = 0;
439 if (this.getMetCd() != null)
440 {
441 cmp = this.getMetCd().compareTo(o.getMetCd());
442 }
443 else
444 {
445 if (this.getMetNm() != null)
446 {
447 cmp = (cmp != 0 ? cmp : this.getMetNm().compareTo(o.getMetNm()));
448 }
449 if (this.getMetDc() != null)
450 {
451 cmp = (cmp != 0 ? cmp : this.getMetDc().compareTo(o.getMetDc()));
452 }
453 if (this.getUpdateDt() != null)
454 {
455 cmp = (cmp != 0 ? cmp : this.getUpdateDt().compareTo(o.getUpdateDt()));
456 }
457 }
458 return cmp;
459 }
460
461
462 }