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.referential;
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.Collection;
31 import java.util.HashSet;
32
33 /**
34 * Liste des états possibles d'un objet.
35 */
36 // HibernateEntity.vsl annotations merge-point
37 public abstract class Status
38 implements Serializable, Comparable<Status>
39 {
40 /**
41 * The serial version UID of this class. Needed for serialization.
42 */
43 private static final long serialVersionUID = 2413971720867301580L;
44
45 // Generate 4 attributes
46 private String statusCd;
47
48 /**
49 * Code de l'état de l'objet (actif ou inactif)
50 * @return this.statusCd String
51 */
52 public String getStatusCd()
53 {
54 return this.statusCd;
55 }
56
57 /**
58 * Code de l'état de l'objet (actif ou inactif)
59 * @param statusCdIn String
60 */
61 public void setStatusCd(String statusCdIn)
62 {
63 this.statusCd = statusCdIn;
64 }
65
66 private String statusNm;
67
68 /**
69 * Libellé de l'état.
70 * @return this.statusNm String
71 */
72 public String getStatusNm()
73 {
74 return this.statusNm;
75 }
76
77 /**
78 * Libellé de l'état.
79 * @param statusNmIn String
80 */
81 public void setStatusNm(String statusNmIn)
82 {
83 this.statusNm = statusNmIn;
84 }
85
86 private String statusDc;
87
88 /**
89 * Description de l'état
90 * @return this.statusDc String
91 */
92 public String getStatusDc()
93 {
94 return this.statusDc;
95 }
96
97 /**
98 * Description de l'état
99 * @param statusDcIn String
100 */
101 public void setStatusDc(String statusDcIn)
102 {
103 this.statusDc = statusDcIn;
104 }
105
106 private Timestamp updateDt;
107
108 /**
109 * Date de modification de l'objet, mise à jour par le système
110 * @return this.updateDt Timestamp
111 */
112 public Timestamp getUpdateDt()
113 {
114 return this.updateDt;
115 }
116
117 /**
118 * Date de modification de l'objet, mise à jour par le système
119 * @param updateDtIn Timestamp
120 */
121 public void setUpdateDt(Timestamp updateDtIn)
122 {
123 this.updateDt = updateDtIn;
124 }
125
126 // Generate 50 associations
127 private Collection<PrecisionType> precisionTypes = new HashSet<PrecisionType>();
128
129 /**
130 * type d'incertitude des mesures d'un paramètre dans une stratégie.
131 * @return this.precisionTypes Collection<PrecisionType>
132 */
133 public Collection<PrecisionType> getPrecisionTypes()
134 {
135 return this.precisionTypes;
136 }
137
138 /**
139 * type d'incertitude des mesures d'un paramètre dans une stratégie.
140 * @param precisionTypesIn Collection<PrecisionType>
141 */
142 public void setPrecisionTypes(Collection<PrecisionType> precisionTypesIn)
143 {
144 this.precisionTypes = precisionTypesIn;
145 }
146
147 /**
148 * type d'incertitude des mesures d'un paramètre dans une stratégie.
149 * @param elementToAdd PrecisionType
150 * @return <tt>true</tt> if this collection changed as a result of the
151 * call
152 */
153 public boolean addPrecisionTypes(PrecisionType elementToAdd)
154 {
155 return this.precisionTypes.add(elementToAdd);
156 }
157
158 /**
159 * type d'incertitude des mesures d'un paramètre dans une stratégie.
160 * @param elementToRemove PrecisionType
161 * @return <tt>true</tt> if this collection changed as a result of the
162 * call
163 */
164 public boolean removePrecisionTypes(PrecisionType elementToRemove)
165 {
166 return this.precisionTypes.remove(elementToRemove);
167 }
168
169 /**
170 * Returns <code>true</code> if the argument is an Status instance and all identifiers for this entity
171 * equal the identifiers of the argument entity. Returns <code>false</code> otherwise.
172 */
173 @Override
174 public boolean equals(Object object)
175 {
176 if (this == object)
177 {
178 return true;
179 }
180 if (!(object instanceof Status))
181 {
182 return false;
183 }
184 final Status that = (Status)object;
185 if (this.statusCd == null || that.getStatusCd() == null || !this.statusCd.equals(that.getStatusCd()))
186 {
187 return false;
188 }
189 return true;
190 }
191
192 /**
193 * Returns a hash code based on this entity's identifiers.
194 */
195 @Override
196 public int hashCode()
197 {
198 int hashCode = 0;
199 hashCode = 29 * hashCode + (this.statusCd == null ? 0 : this.statusCd.hashCode());
200
201 return hashCode;
202 }
203
204 /**
205 * Constructs new instances of {@link Status}.
206 */
207 public static final class Factory
208 {
209 /**
210 * Constructs a new instance of {@link Status}.
211 * @return new StatusImpl()
212 */
213 public static Status newInstance()
214 {
215 return new StatusImpl();
216 }
217
218 /**
219 * Constructs a new instance of {@link Status}, taking all required and/or
220 * read-only properties as arguments, except for identifiers.
221 * @param statusNm String
222 * @return newInstance
223 */
224 public static Status newInstance(String statusNm)
225 {
226 final Status entity = new StatusImpl();
227 entity.setStatusNm(statusNm);
228 return entity;
229 }
230
231 /**
232 * Constructs a new instance of {@link Status}, taking all possible properties
233 * (except the identifier(s))as arguments.
234 * @param statusNm String
235 * @param statusDc String
236 * @param updateDt Timestamp
237 * @param precisionTypes Collection<PrecisionType>
238 * @return newInstance Status
239 */
240 public static Status newInstance(String statusNm, String statusDc, Timestamp updateDt, Collection<PrecisionType> precisionTypes)
241 {
242 final Status entity = new StatusImpl();
243 entity.setStatusNm(statusNm);
244 entity.setStatusDc(statusDc);
245 entity.setUpdateDt(updateDt);
246 entity.setPrecisionTypes(precisionTypes);
247 return entity;
248 }
249 }
250
251 /**
252 * @see Comparable#compareTo
253 */
254 public int compareTo(Status o)
255 {
256 int cmp = 0;
257 if (this.getStatusCd() != null)
258 {
259 cmp = this.getStatusCd().compareTo(o.getStatusCd());
260 }
261 else
262 {
263 if (this.getStatusNm() != null)
264 {
265 cmp = (cmp != 0 ? cmp : this.getStatusNm().compareTo(o.getStatusNm()));
266 }
267 if (this.getStatusDc() != null)
268 {
269 cmp = (cmp != 0 ? cmp : this.getStatusDc().compareTo(o.getStatusDc()));
270 }
271 if (this.getUpdateDt() != null)
272 {
273 cmp = (cmp != 0 ? cmp : this.getUpdateDt().compareTo(o.getUpdateDt()));
274 }
275 }
276 return cmp;
277 }
278 // HibernateEntity.vsl merge-point
279 // Status.java merge-point
280 }