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.data.survey;
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 navires intervenant dans les campagnes ou sorties Quadrige2.
33 */
34 // HibernateEntity.vsl annotations merge-point
35 public abstract class Ship
36 implements Serializable, Comparable<Ship>
37 {
38 /**
39 * The serial version UID of this class. Needed for serialization.
40 */
41 private static final long serialVersionUID = 8817617091158130686L;
42
43 // Generate 5 attributes
44 private Integer shipId;
45
46 /**
47 * Identifiant du navire
48 * @return this.shipId Integer
49 */
50 public Integer getShipId()
51 {
52 return this.shipId;
53 }
54
55 /**
56 * Identifiant du navire
57 * @param shipIdIn Integer
58 */
59 public void setShipId(Integer shipIdIn)
60 {
61 this.shipId = shipIdIn;
62 }
63
64 private String shipLb;
65
66 /**
67 * Mnémonique du navire (qui sera repris du référentiel SISMER). La seule contrainte de ce
68 * mnémonique est d'être unique.
69 * @return this.shipLb String
70 */
71 public String getShipLb()
72 {
73 return this.shipLb;
74 }
75
76 /**
77 * Mnémonique du navire (qui sera repris du référentiel SISMER). La seule contrainte de ce
78 * mnémonique est d'être unique.
79 * @param shipLbIn String
80 */
81 public void setShipLb(String shipLbIn)
82 {
83 this.shipLb = shipLbIn;
84 }
85
86 private String shipNm;
87
88 /**
89 * Libellé du navire
90 * @return this.shipNm String
91 */
92 public String getShipNm()
93 {
94 return this.shipNm;
95 }
96
97 /**
98 * Libellé du navire
99 * @param shipNmIn String
100 */
101 public void setShipNm(String shipNmIn)
102 {
103 this.shipNm = shipNmIn;
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 private Integer remoteId;
127
128 /**
129 *
130 * @return this.remoteId Integer
131 */
132 public Integer getRemoteId()
133 {
134 return this.remoteId;
135 }
136
137 /**
138 *
139 * @param remoteIdIn Integer
140 */
141 public void setRemoteId(Integer remoteIdIn)
142 {
143 this.remoteId = remoteIdIn;
144 }
145
146 // Generate 2 associations
147 /**
148 * Returns <code>true</code> if the argument is an Ship 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 Ship))
159 {
160 return false;
161 }
162 final Ship that = (Ship)object;
163 if (this.shipId == null || that.getShipId() == null || !this.shipId.equals(that.getShipId()))
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.shipId == null ? 0 : this.shipId.hashCode());
178
179 return hashCode;
180 }
181
182 /**
183 * Constructs new instances of {@link Ship}.
184 */
185 public static final class Factory
186 {
187 /**
188 * Constructs a new instance of {@link Ship}.
189 * @return new ShipImpl()
190 */
191 public static Ship newInstance()
192 {
193 return new ShipImpl();
194 }
195
196 /**
197 * Constructs a new instance of {@link Ship}, taking all required and/or
198 * read-only properties as arguments, except for identifiers.
199 * @param shipLb String
200 * @param shipNm String
201 * @return newInstance
202 */
203 public static Ship newInstance(String shipLb, String shipNm)
204 {
205 final Ship entity = new ShipImpl();
206 entity.setShipLb(shipLb);
207 entity.setShipNm(shipNm);
208 return entity;
209 }
210
211 /**
212 * Constructs a new instance of {@link Ship}, taking all possible properties
213 * (except the identifier(s))as arguments.
214 * @param shipLb String
215 * @param shipNm String
216 * @param updateDt Timestamp
217 * @param remoteId Integer
218 * @return newInstance Ship
219 */
220 public static Ship newInstance(String shipLb, String shipNm, Timestamp updateDt, Integer remoteId)
221 {
222 final Ship entity = new ShipImpl();
223 entity.setShipLb(shipLb);
224 entity.setShipNm(shipNm);
225 entity.setUpdateDt(updateDt);
226 entity.setRemoteId(remoteId);
227 return entity;
228 }
229 }
230
231 /**
232 * @see Comparable#compareTo
233 */
234 public int compareTo(Ship o)
235 {
236 int cmp = 0;
237 if (this.getShipId() != null)
238 {
239 cmp = this.getShipId().compareTo(o.getShipId());
240 }
241 else
242 {
243 if (this.getShipLb() != null)
244 {
245 cmp = (cmp != 0 ? cmp : this.getShipLb().compareTo(o.getShipLb()));
246 }
247 if (this.getShipNm() != null)
248 {
249 cmp = (cmp != 0 ? cmp : this.getShipNm().compareTo(o.getShipNm()));
250 }
251 if (this.getUpdateDt() != null)
252 {
253 cmp = (cmp != 0 ? cmp : this.getUpdateDt().compareTo(o.getUpdateDt()));
254 }
255 if (this.getRemoteId() != null)
256 {
257 cmp = (cmp != 0 ? cmp : this.getRemoteId().compareTo(o.getRemoteId()));
258 }
259 }
260 return cmp;
261 }
262 // HibernateEntity.vsl merge-point
263 // Ship.java merge-point
264 }