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
31 /**
32 * Liste des précisions numériques.
33 */
34 // HibernateEntity.vsl annotations merge-point
35 public abstract class NumericalPrecision
36 implements Serializable, Comparable<NumericalPrecision>
37 {
38 /**
39 * The serial version UID of this class. Needed for serialization.
40 */
41 private static final long serialVersionUID = -2734219105151414762L;
42
43 // Generate 4 attributes
44 private Integer numPrecId;
45
46 /**
47 * Identifiant interne de la précision
48 * @return this.numPrecId Integer
49 */
50 public Integer getNumPrecId()
51 {
52 return this.numPrecId;
53 }
54
55 /**
56 * Identifiant interne de la précision
57 * @param numPrecIdIn Integer
58 */
59 public void setNumPrecId(Integer numPrecIdIn)
60 {
61 this.numPrecId = numPrecIdIn;
62 }
63
64 private String numPrecNm;
65
66 /**
67 * Libellé court de la précision
68 * @return this.numPrecNm String
69 */
70 public String getNumPrecNm()
71 {
72 return this.numPrecNm;
73 }
74
75 /**
76 * Libellé court de la précision
77 * @param numPrecNmIn String
78 */
79 public void setNumPrecNm(String numPrecNmIn)
80 {
81 this.numPrecNm = numPrecNmIn;
82 }
83
84 private String numPrecDc;
85
86 /**
87 * Decription complète de la précision
88 * @return this.numPrecDc String
89 */
90 public String getNumPrecDc()
91 {
92 return this.numPrecDc;
93 }
94
95 /**
96 * Decription complète de la précision
97 * @param numPrecDcIn String
98 */
99 public void setNumPrecDc(String numPrecDcIn)
100 {
101 this.numPrecDc = numPrecDcIn;
102 }
103
104 private Timestamp updateDt;
105
106 /**
107 * Date de modification de l'objet, mise à jour par le système
108 * @return this.updateDt Timestamp
109 */
110 public Timestamp getUpdateDt()
111 {
112 return this.updateDt;
113 }
114
115 /**
116 * Date de modification de l'objet, mise à jour par le système
117 * @param updateDtIn Timestamp
118 */
119 public void setUpdateDt(Timestamp updateDtIn)
120 {
121 this.updateDt = updateDtIn;
122 }
123
124 // Generate 3 associations
125 private Status status;
126
127 /**
128 * Liste des états possibles d'un objet.
129 * @return this.status Status
130 */
131 public Status getStatus()
132 {
133 return this.status;
134 }
135
136 /**
137 * Liste des états possibles d'un objet.
138 * @param statusIn Status
139 */
140 public void setStatus(Status statusIn)
141 {
142 this.status = statusIn;
143 }
144
145 /**
146 * Returns <code>true</code> if the argument is an NumericalPrecision instance and all identifiers for this entity
147 * equal the identifiers of the argument entity. Returns <code>false</code> otherwise.
148 */
149 @Override
150 public boolean equals(Object object)
151 {
152 if (this == object)
153 {
154 return true;
155 }
156 if (!(object instanceof NumericalPrecision))
157 {
158 return false;
159 }
160 final NumericalPrecision that = (NumericalPrecision)object;
161 if (this.numPrecId == null || that.getNumPrecId() == null || !this.numPrecId.equals(that.getNumPrecId()))
162 {
163 return false;
164 }
165 return true;
166 }
167
168 /**
169 * Returns a hash code based on this entity's identifiers.
170 */
171 @Override
172 public int hashCode()
173 {
174 int hashCode = 0;
175 hashCode = 29 * hashCode + (this.numPrecId == null ? 0 : this.numPrecId.hashCode());
176
177 return hashCode;
178 }
179
180 /**
181 * Constructs new instances of {@link NumericalPrecision}.
182 */
183 public static final class Factory
184 {
185 /**
186 * Constructs a new instance of {@link NumericalPrecision}.
187 * @return new NumericalPrecisionImpl()
188 */
189 public static NumericalPrecision newInstance()
190 {
191 return new NumericalPrecisionImpl();
192 }
193
194 /**
195 * Constructs a new instance of {@link NumericalPrecision}, taking all required and/or
196 * read-only properties as arguments, except for identifiers.
197 * @param numPrecNm String
198 * @param status Status
199 * @return newInstance
200 */
201 public static NumericalPrecision newInstance(String numPrecNm, Status status)
202 {
203 final NumericalPrecision entity = new NumericalPrecisionImpl();
204 entity.setNumPrecNm(numPrecNm);
205 entity.setStatus(status);
206 return entity;
207 }
208
209 /**
210 * Constructs a new instance of {@link NumericalPrecision}, taking all possible properties
211 * (except the identifier(s))as arguments.
212 * @param numPrecNm String
213 * @param numPrecDc String
214 * @param updateDt Timestamp
215 * @param status Status
216 * @return newInstance NumericalPrecision
217 */
218 public static NumericalPrecision newInstance(String numPrecNm, String numPrecDc, Timestamp updateDt, Status status)
219 {
220 final NumericalPrecision entity = new NumericalPrecisionImpl();
221 entity.setNumPrecNm(numPrecNm);
222 entity.setNumPrecDc(numPrecDc);
223 entity.setUpdateDt(updateDt);
224 entity.setStatus(status);
225 return entity;
226 }
227 }
228
229 /**
230 * @see Comparable#compareTo
231 */
232 public int compareTo(NumericalPrecision o)
233 {
234 int cmp = 0;
235 if (this.getNumPrecId() != null)
236 {
237 cmp = this.getNumPrecId().compareTo(o.getNumPrecId());
238 }
239 else
240 {
241 if (this.getNumPrecNm() != null)
242 {
243 cmp = (cmp != 0 ? cmp : this.getNumPrecNm().compareTo(o.getNumPrecNm()));
244 }
245 if (this.getNumPrecDc() != null)
246 {
247 cmp = (cmp != 0 ? cmp : this.getNumPrecDc().compareTo(o.getNumPrecDc()));
248 }
249 if (this.getUpdateDt() != null)
250 {
251 cmp = (cmp != 0 ? cmp : this.getUpdateDt().compareTo(o.getUpdateDt()));
252 }
253 }
254 return cmp;
255 }
256 // HibernateEntity.vsl merge-point
257 // NumericalPrecision.java merge-point
258 }