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