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.referential.monitoringLocation.MonitoringLocation;
30 import java.io.Serializable;
31 import java.sql.Timestamp;
32 import java.util.Collection;
33 import java.util.HashSet;
34
35
36
37
38
39 public abstract class MonLocMet
40 implements Serializable, Comparable<MonLocMet>
41 {
42
43
44
45 private static final long serialVersionUID = 4669194959258532954L;
46
47
48 private Timestamp updateDt;
49
50
51
52
53
54 public Timestamp getUpdateDt()
55 {
56 return this.updateDt;
57 }
58
59
60
61
62
63 public void setUpdateDt(Timestamp updateDtIn)
64 {
65 this.updateDt = updateDtIn;
66 }
67
68 private Integer monLocMetId;
69
70
71
72
73
74 public Integer getMonLocMetId()
75 {
76 return this.monLocMetId;
77 }
78
79
80
81
82
83 public void setMonLocMetId(Integer monLocMetIdIn)
84 {
85 this.monLocMetId = monLocMetIdIn;
86 }
87
88
89 private Collection<PmfmMet> pmfmMets = new HashSet<PmfmMet>();
90
91
92
93
94
95 public Collection<PmfmMet> getPmfmMets()
96 {
97 return this.pmfmMets;
98 }
99
100
101
102
103
104 public void setPmfmMets(Collection<PmfmMet> pmfmMetsIn)
105 {
106 this.pmfmMets = pmfmMetsIn;
107 }
108
109
110
111
112
113
114
115 public boolean addPmfmMets(PmfmMet elementToAdd)
116 {
117 return this.pmfmMets.add(elementToAdd);
118 }
119
120
121
122
123
124
125
126 public boolean removePmfmMets(PmfmMet elementToRemove)
127 {
128 return this.pmfmMets.remove(elementToRemove);
129 }
130
131 private MonitoringLocation monitoringLocation;
132
133
134
135
136
137 public MonitoringLocation getMonitoringLocation()
138 {
139 return this.monitoringLocation;
140 }
141
142
143
144
145
146 public void setMonitoringLocation(MonitoringLocation monitoringLocationIn)
147 {
148 this.monitoringLocation = monitoringLocationIn;
149 }
150
151 private Metaprogramme metaprogramme;
152
153
154
155
156
157 public Metaprogramme getMetaprogramme()
158 {
159 return this.metaprogramme;
160 }
161
162
163
164
165
166 public void setMetaprogramme(Metaprogramme metaprogrammeIn)
167 {
168 this.metaprogramme = metaprogrammeIn;
169 }
170
171
172
173
174
175 @Override
176 public boolean equals(Object object)
177 {
178 if (this == object)
179 {
180 return true;
181 }
182 if (!(object instanceof MonLocMet))
183 {
184 return false;
185 }
186 final MonLocMet that = (MonLocMet)object;
187 if (this.monLocMetId == null || that.getMonLocMetId() == null || !this.monLocMetId.equals(that.getMonLocMetId()))
188 {
189 return false;
190 }
191 return true;
192 }
193
194
195
196
197 @Override
198 public int hashCode()
199 {
200 int hashCode = 0;
201 hashCode = 29 * hashCode + (this.monLocMetId == null ? 0 : this.monLocMetId.hashCode());
202
203 return hashCode;
204 }
205
206
207
208
209 public static final class Factory
210 {
211
212
213
214
215 public static MonLocMet newInstance()
216 {
217 return new MonLocMetImpl();
218 }
219
220
221
222
223
224
225
226
227
228 public static MonLocMet newInstance(Timestamp updateDt, MonitoringLocation monitoringLocation, Metaprogramme metaprogramme)
229 {
230 final MonLocMet entity = new MonLocMetImpl();
231 entity.setUpdateDt(updateDt);
232 entity.setMonitoringLocation(monitoringLocation);
233 entity.setMetaprogramme(metaprogramme);
234 return entity;
235 }
236
237
238
239
240
241
242
243
244
245
246 public static MonLocMet newInstance(Timestamp updateDt, Collection<PmfmMet> pmfmMets, MonitoringLocation monitoringLocation, Metaprogramme metaprogramme)
247 {
248 final MonLocMet entity = new MonLocMetImpl();
249 entity.setUpdateDt(updateDt);
250 entity.setPmfmMets(pmfmMets);
251 entity.setMonitoringLocation(monitoringLocation);
252 entity.setMetaprogramme(metaprogramme);
253 return entity;
254 }
255 }
256
257
258
259
260 public int compareTo(MonLocMet o)
261 {
262 int cmp = 0;
263 if (this.getMonLocMetId() != null)
264 {
265 cmp = this.getMonLocMetId().compareTo(o.getMonLocMetId());
266 }
267 else
268 {
269 if (this.getUpdateDt() != null)
270 {
271 cmp = (cmp != 0 ? cmp : this.getUpdateDt().compareTo(o.getUpdateDt()));
272 }
273 }
274 return cmp;
275 }
276
277
278 }