1
2
3
4
5
6 package fr.ifremer.quadrige2.core.dao.system;
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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
37
38
39 public abstract class MonLocHisGeom
40 implements Serializable, Comparable<MonLocHisGeom>
41 {
42
43
44
45 private static final long serialVersionUID = 3803139124304035734L;
46
47
48 private Integer monLocHisGeomId;
49
50
51
52
53
54 public Integer getMonLocHisGeomId()
55 {
56 return this.monLocHisGeomId;
57 }
58
59
60
61
62
63 public void setMonLocHisGeomId(Integer monLocHisGeomIdIn)
64 {
65 this.monLocHisGeomId = monLocHisGeomIdIn;
66 }
67
68 private Geometry monLocPosition;
69
70
71
72
73
74 public Geometry getMonLocPosition()
75 {
76 return this.monLocPosition;
77 }
78
79
80
81
82
83 public void setMonLocPosition(Geometry monLocPositionIn)
84 {
85 this.monLocPosition = monLocPositionIn;
86 }
87
88 private Timestamp updateDt;
89
90
91
92
93
94 public Timestamp getUpdateDt()
95 {
96 return this.updateDt;
97 }
98
99
100
101
102
103 public void setUpdateDt(Timestamp updateDtIn)
104 {
105 this.updateDt = updateDtIn;
106 }
107
108
109 private PositionningSystem posSystemId;
110
111
112
113
114
115 public PositionningSystem getPosSystemId()
116 {
117 return this.posSystemId;
118 }
119
120
121
122
123
124 public void setPosSystemId(PositionningSystem posSystemIdIn)
125 {
126 this.posSystemId = posSystemIdIn;
127 }
128
129 private MonitoringLocation monitoringLocation;
130
131
132
133
134
135 public MonitoringLocation getMonitoringLocation()
136 {
137 return this.monitoringLocation;
138 }
139
140
141
142
143
144 public void setMonitoringLocation(MonitoringLocation monitoringLocationIn)
145 {
146 this.monitoringLocation = monitoringLocationIn;
147 }
148
149
150
151
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
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
186
187 public static final class Factory
188 {
189
190
191
192
193 public static MonLocHisGeom newInstance()
194 {
195 return new MonLocHisGeomImpl();
196 }
197
198
199
200
201
202
203
204
205
206
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
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
243
244 }