1 // license-header java merge-point
2 //
3 // Attention: Generated code! Do not modify by hand!
4 // Generated by: hibernate/HibernateEntity.vsl in andromda-hibernate-cartridge.
5 //
6 package fr.ifremer.quadrige2.core.dao.data.survey;
7
8 /*-
9 * #%L
10 * Quadrige2 Core :: Server API
11 * %%
12 * Copyright (C) 2017 Ifremer
13 * %%
14 * This program is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Affero General Public License as published by
16 * the Free Software Foundation, either version 3 of the License, or
17 * (at your option) any later version.
18 *
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * You should have received a copy of the GNU Affero General Public License
25 * along with this program. If not, see <http://www.gnu.org/licenses/>.
26 * #L%
27 */
28
29 import fr.ifremer.quadrige2.core.dao.referential.QualityFlag;
30 import java.io.Serializable;
31 import java.sql.Timestamp;
32 import java.util.Date;
33
34 /**
35 * Liste des vidéos sur un passage.
36 */
37 // HibernateEntity.vsl annotations merge-point
38 public abstract class Video
39 implements Serializable, Comparable<Video>
40 {
41 /**
42 * The serial version UID of this class. Needed for serialization.
43 */
44 private static final long serialVersionUID = 2771970235780835105L;
45
46 // Generate 8 attributes
47 private Integer videoId;
48
49 /**
50 * Identifiant interne de la vidéo.
51 * @return this.videoId Integer
52 */
53 public Integer getVideoId()
54 {
55 return this.videoId;
56 }
57
58 /**
59 * Identifiant interne de la vidéo.
60 * @param videoIdIn Integer
61 */
62 public void setVideoId(Integer videoIdIn)
63 {
64 this.videoId = videoIdIn;
65 }
66
67 private String videoNm;
68
69 /**
70 * Libellé de la vidéo
71 * @return this.videoNm String
72 */
73 public String getVideoNm()
74 {
75 return this.videoNm;
76 }
77
78 /**
79 * Libellé de la vidéo
80 * @param videoNmIn String
81 */
82 public void setVideoNm(String videoNmIn)
83 {
84 this.videoNm = videoNmIn;
85 }
86
87 private String videoCm;
88
89 /**
90 * Commentaire de la vidéo
91 * @return this.videoCm String
92 */
93 public String getVideoCm()
94 {
95 return this.videoCm;
96 }
97
98 /**
99 * Commentaire de la vidéo
100 * @param videoCmIn String
101 */
102 public void setVideoCm(String videoCmIn)
103 {
104 this.videoCm = videoCmIn;
105 }
106
107 private String videoLk;
108
109 /**
110 * Lien vers le serveur SISMER de vidéo. Probablement une URL
111 * @return this.videoLk String
112 */
113 public String getVideoLk()
114 {
115 return this.videoLk;
116 }
117
118 /**
119 * Lien vers le serveur SISMER de vidéo. Probablement une URL
120 * @param videoLkIn String
121 */
122 public void setVideoLk(String videoLkIn)
123 {
124 this.videoLk = videoLkIn;
125 }
126
127 private Date videoValidDt;
128
129 /**
130 * Date de validation
131 * @return this.videoValidDt Date
132 */
133 public Date getVideoValidDt()
134 {
135 return this.videoValidDt;
136 }
137
138 /**
139 * Date de validation
140 * @param videoValidDtIn Date
141 */
142 public void setVideoValidDt(Date videoValidDtIn)
143 {
144 this.videoValidDt = videoValidDtIn;
145 }
146
147 private Date videoQualifDt;
148
149 /**
150 * Date de qualification
151 * @return this.videoQualifDt Date
152 */
153 public Date getVideoQualifDt()
154 {
155 return this.videoQualifDt;
156 }
157
158 /**
159 * Date de qualification
160 * @param videoQualifDtIn Date
161 */
162 public void setVideoQualifDt(Date videoQualifDtIn)
163 {
164 this.videoQualifDt = videoQualifDtIn;
165 }
166
167 private String videoQualifCm;
168
169 /**
170 * Commentaire de qualification
171 * @return this.videoQualifCm String
172 */
173 public String getVideoQualifCm()
174 {
175 return this.videoQualifCm;
176 }
177
178 /**
179 * Commentaire de qualification
180 * @param videoQualifCmIn String
181 */
182 public void setVideoQualifCm(String videoQualifCmIn)
183 {
184 this.videoQualifCm = videoQualifCmIn;
185 }
186
187 private Timestamp updateDt;
188
189 /**
190 * Date de modification de l'objet, mise à jour par le système
191 * @return this.updateDt Timestamp
192 */
193 public Timestamp getUpdateDt()
194 {
195 return this.updateDt;
196 }
197
198 /**
199 * Date de modification de l'objet, mise à jour par le système
200 * @param updateDtIn Timestamp
201 */
202 public void setUpdateDt(Timestamp updateDtIn)
203 {
204 this.updateDt = updateDtIn;
205 }
206
207 // Generate 2 associations
208 private QualityFlag qualFlagCd;
209
210 /**
211 * Liste des niveaux de qualification.
212 * @return this.qualFlagCd QualityFlag
213 */
214 public QualityFlag getQualFlagCd()
215 {
216 return this.qualFlagCd;
217 }
218
219 /**
220 * Liste des niveaux de qualification.
221 * @param qualFlagCdIn QualityFlag
222 */
223 public void setQualFlagCd(QualityFlag qualFlagCdIn)
224 {
225 this.qualFlagCd = qualFlagCdIn;
226 }
227
228 private Survey survey;
229
230 /**
231 * Liste les différents passages effectués sur un lieu de surveillance.
232 * Liste les différents passages effectués sur un lieu de surveillance.
233 * @return this.survey Survey
234 */
235 public Survey getSurvey()
236 {
237 return this.survey;
238 }
239
240 /**
241 * Liste les différents passages effectués sur un lieu de surveillance.
242 * Liste les différents passages effectués sur un lieu de surveillance.
243 * @param surveyIn Survey
244 */
245 public void setSurvey(Survey surveyIn)
246 {
247 this.survey = surveyIn;
248 }
249
250 /**
251 * Returns <code>true</code> if the argument is an Video instance and all identifiers for this entity
252 * equal the identifiers of the argument entity. Returns <code>false</code> otherwise.
253 */
254 @Override
255 public boolean equals(Object object)
256 {
257 if (this == object)
258 {
259 return true;
260 }
261 if (!(object instanceof Video))
262 {
263 return false;
264 }
265 final Video that = (Video)object;
266 if (this.videoId == null || that.getVideoId() == null || !this.videoId.equals(that.getVideoId()))
267 {
268 return false;
269 }
270 return true;
271 }
272
273 /**
274 * Returns a hash code based on this entity's identifiers.
275 */
276 @Override
277 public int hashCode()
278 {
279 int hashCode = 0;
280 hashCode = 29 * hashCode + (this.videoId == null ? 0 : this.videoId.hashCode());
281
282 return hashCode;
283 }
284
285 /**
286 * Constructs new instances of {@link Video}.
287 */
288 public static final class Factory
289 {
290 /**
291 * Constructs a new instance of {@link Video}.
292 * @return new VideoImpl()
293 */
294 public static Video newInstance()
295 {
296 return new VideoImpl();
297 }
298
299 /**
300 * Constructs a new instance of {@link Video}, taking all required and/or
301 * read-only properties as arguments, except for identifiers.
302 * @param updateDt Timestamp
303 * @return newInstance
304 */
305 public static Video newInstance(Timestamp updateDt)
306 {
307 final Video entity = new VideoImpl();
308 entity.setUpdateDt(updateDt);
309 return entity;
310 }
311
312 /**
313 * Constructs a new instance of {@link Video}, taking all possible properties
314 * (except the identifier(s))as arguments.
315 * @param videoNm String
316 * @param videoCm String
317 * @param videoLk String
318 * @param videoValidDt Date
319 * @param videoQualifDt Date
320 * @param videoQualifCm String
321 * @param updateDt Timestamp
322 * @param qualFlagCd QualityFlag
323 * @param survey Survey
324 * @return newInstance Video
325 */
326 public static Video newInstance(String videoNm, String videoCm, String videoLk, Date videoValidDt, Date videoQualifDt, String videoQualifCm, Timestamp updateDt, QualityFlag qualFlagCd, Survey survey)
327 {
328 final Video entity = new VideoImpl();
329 entity.setVideoNm(videoNm);
330 entity.setVideoCm(videoCm);
331 entity.setVideoLk(videoLk);
332 entity.setVideoValidDt(videoValidDt);
333 entity.setVideoQualifDt(videoQualifDt);
334 entity.setVideoQualifCm(videoQualifCm);
335 entity.setUpdateDt(updateDt);
336 entity.setQualFlagCd(qualFlagCd);
337 entity.setSurvey(survey);
338 return entity;
339 }
340 }
341
342 /**
343 * @see Comparable#compareTo
344 */
345 public int compareTo(Video o)
346 {
347 int cmp = 0;
348 if (this.getVideoId() != null)
349 {
350 cmp = this.getVideoId().compareTo(o.getVideoId());
351 }
352 else
353 {
354 if (this.getVideoNm() != null)
355 {
356 cmp = (cmp != 0 ? cmp : this.getVideoNm().compareTo(o.getVideoNm()));
357 }
358 if (this.getVideoCm() != null)
359 {
360 cmp = (cmp != 0 ? cmp : this.getVideoCm().compareTo(o.getVideoCm()));
361 }
362 if (this.getVideoLk() != null)
363 {
364 cmp = (cmp != 0 ? cmp : this.getVideoLk().compareTo(o.getVideoLk()));
365 }
366 if (this.getVideoValidDt() != null)
367 {
368 cmp = (cmp != 0 ? cmp : this.getVideoValidDt().compareTo(o.getVideoValidDt()));
369 }
370 if (this.getVideoQualifDt() != null)
371 {
372 cmp = (cmp != 0 ? cmp : this.getVideoQualifDt().compareTo(o.getVideoQualifDt()));
373 }
374 if (this.getVideoQualifCm() != null)
375 {
376 cmp = (cmp != 0 ? cmp : this.getVideoQualifCm().compareTo(o.getVideoQualifCm()));
377 }
378 if (this.getUpdateDt() != null)
379 {
380 cmp = (cmp != 0 ? cmp : this.getUpdateDt().compareTo(o.getUpdateDt()));
381 }
382 }
383 return cmp;
384 }
385 // HibernateEntity.vsl merge-point
386 // Video.java merge-point
387 }