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