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