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.quadrige3.core.dao.system.extraction;
7
8 /*-
9 * #%L
10 * Quadrige3 Core :: Client API
11 * %%
12 * Copyright (C) 2017 - 2024 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 import java.io.Serializable;
29 import java.sql.Timestamp;
30 import java.util.Date;
31
32 /**
33 * Ensemble des périodes saisies par l'utilisateur pour une extraction
34 */
35 // HibernateEntity.vsl annotations merge-point
36 public abstract class ExtractSurveyPeriod
37 implements Serializable, Comparable<ExtractSurveyPeriod>
38 {
39 /**
40 * The serial version UID of this class. Needed for serialization.
41 */
42 private static final long serialVersionUID = -7438515481671501123L;
43
44 // Generate 4 attributes
45 private Integer extractSurveyPeriodId;
46
47 /**
48 * identifiant interne de la période saisie pour le filtre d'extraction
49 * @return this.extractSurveyPeriodId Integer
50 */
51 public Integer getExtractSurveyPeriodId()
52 {
53 return this.extractSurveyPeriodId;
54 }
55
56 /**
57 * identifiant interne de la période saisie pour le filtre d'extraction
58 * @param extractSurveyPeriodIdIn Integer
59 */
60 public void setExtractSurveyPeriodId(Integer extractSurveyPeriodIdIn)
61 {
62 this.extractSurveyPeriodId = extractSurveyPeriodIdIn;
63 }
64
65 private Date extractSurveyPeriodStartDt;
66
67 /**
68 * début de la période
69 * @return this.extractSurveyPeriodStartDt Date
70 */
71 public Date getExtractSurveyPeriodStartDt()
72 {
73 return this.extractSurveyPeriodStartDt;
74 }
75
76 /**
77 * début de la période
78 * @param extractSurveyPeriodStartDtIn Date
79 */
80 public void setExtractSurveyPeriodStartDt(Date extractSurveyPeriodStartDtIn)
81 {
82 this.extractSurveyPeriodStartDt = extractSurveyPeriodStartDtIn;
83 }
84
85 private Date extractSurveyPeriodEndDt;
86
87 /**
88 * fin de la période
89 * @return this.extractSurveyPeriodEndDt Date
90 */
91 public Date getExtractSurveyPeriodEndDt()
92 {
93 return this.extractSurveyPeriodEndDt;
94 }
95
96 /**
97 * fin de la période
98 * @param extractSurveyPeriodEndDtIn Date
99 */
100 public void setExtractSurveyPeriodEndDt(Date extractSurveyPeriodEndDtIn)
101 {
102 this.extractSurveyPeriodEndDt = extractSurveyPeriodEndDtIn;
103 }
104
105 private Timestamp updateDt;
106
107 /**
108 * Date de modification de l'objet, mise à jour par le système
109 * @return this.updateDt Timestamp
110 */
111 public Timestamp getUpdateDt()
112 {
113 return this.updateDt;
114 }
115
116 /**
117 * Date de modification de l'objet, mise à jour par le système
118 * @param updateDtIn Timestamp
119 */
120 public void setUpdateDt(Timestamp updateDtIn)
121 {
122 this.updateDt = updateDtIn;
123 }
124
125 // Generate 1 associations
126 private ExtractFilter extractFilter;
127
128 /**
129 * Définit les éléments supplémentaires au filtre et nécessaires à l'extraction.
130 * @return this.extractFilter ExtractFilter
131 */
132 public ExtractFilter getExtractFilter()
133 {
134 return this.extractFilter;
135 }
136
137 /**
138 * Définit les éléments supplémentaires au filtre et nécessaires à l'extraction.
139 * @param extractFilterIn ExtractFilter
140 */
141 public void setExtractFilter(ExtractFilter extractFilterIn)
142 {
143 this.extractFilter = extractFilterIn;
144 }
145
146 /**
147 * Returns <code>true</code> if the argument is an ExtractSurveyPeriod instance and all identifiers for this entity
148 * equal the identifiers of the argument entity. Returns <code>false</code> otherwise.
149 */
150 @Override
151 public boolean equals(Object object)
152 {
153 if (this == object)
154 {
155 return true;
156 }
157 if (!(object instanceof ExtractSurveyPeriod))
158 {
159 return false;
160 }
161 final ExtractSurveyPeriod that = (ExtractSurveyPeriod)object;
162 if (this.extractSurveyPeriodId == null || that.getExtractSurveyPeriodId() == null || !this.extractSurveyPeriodId.equals(that.getExtractSurveyPeriodId()))
163 {
164 return false;
165 }
166 return true;
167 }
168
169 /**
170 * Returns a hash code based on this entity's identifiers.
171 */
172 @Override
173 public int hashCode()
174 {
175 int hashCode = 0;
176 hashCode = 29 * hashCode + (this.extractSurveyPeriodId == null ? 0 : this.extractSurveyPeriodId.hashCode());
177
178 return hashCode;
179 }
180
181 /**
182 * Constructs new instances of {@link ExtractSurveyPeriod}.
183 */
184 public static final class Factory
185 {
186 /**
187 * Constructs a new instance of {@link ExtractSurveyPeriod}.
188 * @return new ExtractSurveyPeriodImpl()
189 */
190 public static ExtractSurveyPeriod newInstance()
191 {
192 return new ExtractSurveyPeriodImpl();
193 }
194
195 /**
196 * Constructs a new instance of {@link ExtractSurveyPeriod}, taking all required and/or
197 * read-only properties as arguments, except for identifiers.
198 * @param extractSurveyPeriodStartDt Date
199 * @param extractSurveyPeriodEndDt Date
200 * @param extractFilter ExtractFilter
201 * @return newInstance
202 */
203 public static ExtractSurveyPeriod newInstance(Date extractSurveyPeriodStartDt, Date extractSurveyPeriodEndDt, ExtractFilter extractFilter)
204 {
205 final ExtractSurveyPeriod entity = new ExtractSurveyPeriodImpl();
206 entity.setExtractSurveyPeriodStartDt(extractSurveyPeriodStartDt);
207 entity.setExtractSurveyPeriodEndDt(extractSurveyPeriodEndDt);
208 entity.setExtractFilter(extractFilter);
209 return entity;
210 }
211
212 /**
213 * Constructs a new instance of {@link ExtractSurveyPeriod}, taking all possible properties
214 * (except the identifier(s))as arguments.
215 * @param extractSurveyPeriodStartDt Date
216 * @param extractSurveyPeriodEndDt Date
217 * @param updateDt Timestamp
218 * @param extractFilter ExtractFilter
219 * @return newInstance ExtractSurveyPeriod
220 */
221 public static ExtractSurveyPeriod newInstance(Date extractSurveyPeriodStartDt, Date extractSurveyPeriodEndDt, Timestamp updateDt, ExtractFilter extractFilter)
222 {
223 final ExtractSurveyPeriod entity = new ExtractSurveyPeriodImpl();
224 entity.setExtractSurveyPeriodStartDt(extractSurveyPeriodStartDt);
225 entity.setExtractSurveyPeriodEndDt(extractSurveyPeriodEndDt);
226 entity.setUpdateDt(updateDt);
227 entity.setExtractFilter(extractFilter);
228 return entity;
229 }
230 }
231
232 /**
233 * @see Comparable#compareTo
234 */
235 public int compareTo(ExtractSurveyPeriod o)
236 {
237 int cmp = 0;
238 if (this.getExtractSurveyPeriodId() != null)
239 {
240 cmp = this.getExtractSurveyPeriodId().compareTo(o.getExtractSurveyPeriodId());
241 }
242 else
243 {
244 if (this.getExtractSurveyPeriodStartDt() != null)
245 {
246 cmp = (cmp != 0 ? cmp : this.getExtractSurveyPeriodStartDt().compareTo(o.getExtractSurveyPeriodStartDt()));
247 }
248 if (this.getExtractSurveyPeriodEndDt() != null)
249 {
250 cmp = (cmp != 0 ? cmp : this.getExtractSurveyPeriodEndDt().compareTo(o.getExtractSurveyPeriodEndDt()));
251 }
252 if (this.getUpdateDt() != null)
253 {
254 cmp = (cmp != 0 ? cmp : this.getUpdateDt().compareTo(o.getUpdateDt()));
255 }
256 }
257 return cmp;
258 }
259 // HibernateEntity.vsl merge-point
260 // ExtractSurveyPeriod.java merge-point
261 }