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;
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 fr.ifremer.quadrige3.core.dao.referential.monitoringLocation.MonitoringLocation;
29 import fr.ifremer.quadrige3.core.dao.referential.monitoringLocation.PositionningSystem;
30 import java.io.Serializable;
31 import java.sql.Timestamp;
32
33 /**
34 * Gestion de l'historique des géométries des lieux de surveillance.
35 */
36 // HibernateEntity.vsl annotations merge-point
37 public abstract class MonLocHisGeom
38 implements Serializable, Comparable<MonLocHisGeom>
39 {
40 /**
41 * The serial version UID of this class. Needed for serialization.
42 */
43 private static final long serialVersionUID = 3803139124304035734L;
44
45 // Generate 3 attributes
46 private Integer monLocHisGeomId;
47
48 /**
49 * Identifiant de la ligne d'historique
50 * @return this.monLocHisGeomId Integer
51 */
52 public Integer getMonLocHisGeomId()
53 {
54 return this.monLocHisGeomId;
55 }
56
57 /**
58 * Identifiant de la ligne d'historique
59 * @param monLocHisGeomIdIn Integer
60 */
61 public void setMonLocHisGeomId(Integer monLocHisGeomIdIn)
62 {
63 this.monLocHisGeomId = monLocHisGeomIdIn;
64 }
65
66 private String monLocPosition;
67
68 /**
69 * Positionnement de l'objet
70 * @return this.monLocPosition String
71 */
72 public String getMonLocPosition()
73 {
74 return this.monLocPosition;
75 }
76
77 /**
78 * Positionnement de l'objet
79 * @param monLocPositionIn String
80 */
81 public void setMonLocPosition(String monLocPositionIn)
82 {
83 this.monLocPosition = monLocPositionIn;
84 }
85
86 private Timestamp updateDt;
87
88 /**
89 * Date de modification de l'objet, mise à jour par le système
90 * @return this.updateDt Timestamp
91 */
92 public Timestamp getUpdateDt()
93 {
94 return this.updateDt;
95 }
96
97 /**
98 * Date de modification de l'objet, mise à jour par le système
99 * @param updateDtIn Timestamp
100 */
101 public void setUpdateDt(Timestamp updateDtIn)
102 {
103 this.updateDt = updateDtIn;
104 }
105
106 // Generate 2 associations
107 private PositionningSystem posSystemId;
108
109 /**
110 * Informations complémentaires sur le positionnement d'un objet.
111 * @return this.posSystemId PositionningSystem
112 */
113 public PositionningSystem getPosSystemId()
114 {
115 return this.posSystemId;
116 }
117
118 /**
119 * Informations complémentaires sur le positionnement d'un objet.
120 * @param posSystemIdIn PositionningSystem
121 */
122 public void setPosSystemId(PositionningSystem posSystemIdIn)
123 {
124 this.posSystemId = posSystemIdIn;
125 }
126
127 private MonitoringLocation monitoringLocation;
128
129 /**
130 * Liste les lieux associés aux programmes de surveillance.
131 * @return this.monitoringLocation MonitoringLocation
132 */
133 public MonitoringLocation getMonitoringLocation()
134 {
135 return this.monitoringLocation;
136 }
137
138 /**
139 * Liste les lieux associés aux programmes de surveillance.
140 * @param monitoringLocationIn MonitoringLocation
141 */
142 public void setMonitoringLocation(MonitoringLocation monitoringLocationIn)
143 {
144 this.monitoringLocation = monitoringLocationIn;
145 }
146
147 /**
148 * Returns <code>true</code> if the argument is an MonLocHisGeom instance and all identifiers for this entity
149 * equal the identifiers of the argument entity. Returns <code>false</code> otherwise.
150 */
151 @Override
152 public boolean equals(Object object)
153 {
154 if (this == object)
155 {
156 return true;
157 }
158 if (!(object instanceof MonLocHisGeom))
159 {
160 return false;
161 }
162 final MonLocHisGeom that = (MonLocHisGeom)object;
163 if (this.monLocHisGeomId == null || that.getMonLocHisGeomId() == null || !this.monLocHisGeomId.equals(that.getMonLocHisGeomId()))
164 {
165 return false;
166 }
167 return true;
168 }
169
170 /**
171 * Returns a hash code based on this entity's identifiers.
172 */
173 @Override
174 public int hashCode()
175 {
176 int hashCode = 0;
177 hashCode = 29 * hashCode + (this.monLocHisGeomId == null ? 0 : this.monLocHisGeomId.hashCode());
178
179 return hashCode;
180 }
181
182 /**
183 * Constructs new instances of {@link MonLocHisGeom}.
184 */
185 public static final class Factory
186 {
187 /**
188 * Constructs a new instance of {@link MonLocHisGeom}.
189 * @return new MonLocHisGeomImpl()
190 */
191 public static MonLocHisGeom newInstance()
192 {
193 return new MonLocHisGeomImpl();
194 }
195
196 /**
197 * Constructs a new instance of {@link MonLocHisGeom}, taking all required and/or
198 * read-only properties as arguments, except for identifiers.
199 * @param monLocPosition String
200 * @param posSystemId PositionningSystem
201 * @param monitoringLocation MonitoringLocation
202 * @return newInstance
203 */
204 public static MonLocHisGeom newInstance(String monLocPosition, PositionningSystem posSystemId, MonitoringLocation monitoringLocation)
205 {
206 final MonLocHisGeom entity = new MonLocHisGeomImpl();
207 entity.setMonLocPosition(monLocPosition);
208 entity.setPosSystemId(posSystemId);
209 entity.setMonitoringLocation(monitoringLocation);
210 return entity;
211 }
212
213 /**
214 * Constructs a new instance of {@link MonLocHisGeom}, taking all possible properties
215 * (except the identifier(s))as arguments.
216 * @param monLocPosition String
217 * @param updateDt Timestamp
218 * @param posSystemId PositionningSystem
219 * @param monitoringLocation MonitoringLocation
220 * @return newInstance MonLocHisGeom
221 */
222 public static MonLocHisGeom newInstance(String monLocPosition, Timestamp updateDt, PositionningSystem posSystemId, MonitoringLocation monitoringLocation)
223 {
224 final MonLocHisGeom entity = new MonLocHisGeomImpl();
225 entity.setMonLocPosition(monLocPosition);
226 entity.setUpdateDt(updateDt);
227 entity.setPosSystemId(posSystemId);
228 entity.setMonitoringLocation(monitoringLocation);
229 return entity;
230 }
231 }
232
233 /**
234 * @see Comparable#compareTo
235 */
236 public int compareTo(MonLocHisGeom o)
237 {
238 int cmp = 0;
239 if (this.getMonLocHisGeomId() != null)
240 {
241 cmp = this.getMonLocHisGeomId().compareTo(o.getMonLocHisGeomId());
242 }
243 else
244 {
245 if (this.getMonLocPosition() != null)
246 {
247 cmp = (cmp != 0 ? cmp : this.getMonLocPosition().compareTo(o.getMonLocPosition()));
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 // MonLocHisGeom.java merge-point
258 }