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 fr.ifremer.quadrige2.core.dao.administration.user.Department;
30 import fr.ifremer.quadrige2.core.dao.administration.user.Quser;
31 import java.io.Serializable;
32 import java.sql.Timestamp;
33
34 /**
35 * Projet cartographique
36 */
37 // HibernateEntity.vsl annotations merge-point
38 public abstract class MapProject
39 implements Serializable, Comparable<MapProject>
40 {
41 /**
42 * The serial version UID of this class. Needed for serialization.
43 */
44 private static final long serialVersionUID = -6142234822980131325L;
45
46 // Generate 4 attributes
47 private Integer mapProjectId;
48
49 /**
50 * Identifiant du projet cartographique
51 * @return this.mapProjectId Integer
52 */
53 public Integer getMapProjectId()
54 {
55 return this.mapProjectId;
56 }
57
58 /**
59 * Identifiant du projet cartographique
60 * @param mapProjectIdIn Integer
61 */
62 public void setMapProjectId(Integer mapProjectIdIn)
63 {
64 this.mapProjectId = mapProjectIdIn;
65 }
66
67 private String mapProjectNm;
68
69 /**
70 * Libellé du projet
71 * @return this.mapProjectNm String
72 */
73 public String getMapProjectNm()
74 {
75 return this.mapProjectNm;
76 }
77
78 /**
79 * Libellé du projet
80 * @param mapProjectNmIn String
81 */
82 public void setMapProjectNm(String mapProjectNmIn)
83 {
84 this.mapProjectNm = mapProjectNmIn;
85 }
86
87 private String mapProjetConfig;
88
89 /**
90 * Contenu du projet cartographique
91 * @return this.mapProjetConfig String
92 */
93 public String getMapProjetConfig()
94 {
95 return this.mapProjetConfig;
96 }
97
98 /**
99 * Contenu du projet cartographique
100 * @param mapProjetConfigIn String
101 */
102 public void setMapProjetConfig(String mapProjetConfigIn)
103 {
104 this.mapProjetConfig = mapProjetConfigIn;
105 }
106
107 private Timestamp updateDt;
108
109 /**
110 * Date de mise à jour
111 * @return this.updateDt Timestamp
112 */
113 public Timestamp getUpdateDt()
114 {
115 return this.updateDt;
116 }
117
118 /**
119 * Date de mise à jour
120 * @param updateDtIn Timestamp
121 */
122 public void setUpdateDt(Timestamp updateDtIn)
123 {
124 this.updateDt = updateDtIn;
125 }
126
127 // Generate 3 associations
128 private Department depId;
129
130 /**
131 * Liste les départements ou services auxquels sont rattachés les agents
132 * @return this.depId Department
133 */
134 public Department getDepId()
135 {
136 return this.depId;
137 }
138
139 /**
140 * Liste les départements ou services auxquels sont rattachés les agents
141 * @param depIdIn Department
142 */
143 public void setDepId(Department depIdIn)
144 {
145 this.depId = depIdIn;
146 }
147
148 private Quser quserId;
149
150 /**
151 * Liste l'ensemble des agents et utilisateurs du système.
152 * @return this.quserId Quser
153 */
154 public Quser getQuserId()
155 {
156 return this.quserId;
157 }
158
159 /**
160 * Liste l'ensemble des agents et utilisateurs du système.
161 * @param quserIdIn Quser
162 */
163 public void setQuserId(Quser quserIdIn)
164 {
165 this.quserId = quserIdIn;
166 }
167
168 /**
169 * Returns <code>true</code> if the argument is an MapProject instance and all identifiers for this entity
170 * equal the identifiers of the argument entity. Returns <code>false</code> otherwise.
171 */
172 @Override
173 public boolean equals(Object object)
174 {
175 if (this == object)
176 {
177 return true;
178 }
179 if (!(object instanceof MapProject))
180 {
181 return false;
182 }
183 final MapProject that = (MapProject)object;
184 if (this.mapProjectId == null || that.getMapProjectId() == null || !this.mapProjectId.equals(that.getMapProjectId()))
185 {
186 return false;
187 }
188 return true;
189 }
190
191 /**
192 * Returns a hash code based on this entity's identifiers.
193 */
194 @Override
195 public int hashCode()
196 {
197 int hashCode = 0;
198 hashCode = 29 * hashCode + (this.mapProjectId == null ? 0 : this.mapProjectId.hashCode());
199
200 return hashCode;
201 }
202
203 /**
204 * Constructs new instances of {@link MapProject}.
205 */
206 public static final class Factory
207 {
208 /**
209 * Constructs a new instance of {@link MapProject}.
210 * @return new MapProjectImpl()
211 */
212 public static MapProject newInstance()
213 {
214 return new MapProjectImpl();
215 }
216
217 /**
218 * Constructs a new instance of {@link MapProject}, taking all required and/or
219 * read-only properties as arguments, except for identifiers.
220 * @param mapProjectNm String
221 * @param updateDt Timestamp
222 * @param quserId Quser
223 * @return newInstance
224 */
225 public static MapProject newInstance(String mapProjectNm, Timestamp updateDt, Quser quserId)
226 {
227 final MapProject entity = new MapProjectImpl();
228 entity.setMapProjectNm(mapProjectNm);
229 entity.setUpdateDt(updateDt);
230 entity.setQuserId(quserId);
231 return entity;
232 }
233
234 /**
235 * Constructs a new instance of {@link MapProject}, taking all possible properties
236 * (except the identifier(s))as arguments.
237 * @param mapProjectNm String
238 * @param mapProjetConfig String
239 * @param updateDt Timestamp
240 * @param depId Department
241 * @param quserId Quser
242 * @return newInstance MapProject
243 */
244 public static MapProject newInstance(String mapProjectNm, String mapProjetConfig, Timestamp updateDt, Department depId, Quser quserId)
245 {
246 final MapProject entity = new MapProjectImpl();
247 entity.setMapProjectNm(mapProjectNm);
248 entity.setMapProjetConfig(mapProjetConfig);
249 entity.setUpdateDt(updateDt);
250 entity.setDepId(depId);
251 entity.setQuserId(quserId);
252 return entity;
253 }
254 }
255
256 /**
257 * @see Comparable#compareTo
258 */
259 public int compareTo(MapProject o)
260 {
261 int cmp = 0;
262 if (this.getMapProjectId() != null)
263 {
264 cmp = this.getMapProjectId().compareTo(o.getMapProjectId());
265 }
266 else
267 {
268 if (this.getMapProjectNm() != null)
269 {
270 cmp = (cmp != 0 ? cmp : this.getMapProjectNm().compareTo(o.getMapProjectNm()));
271 }
272 if (this.getMapProjetConfig() != null)
273 {
274 cmp = (cmp != 0 ? cmp : this.getMapProjetConfig().compareTo(o.getMapProjetConfig()));
275 }
276 if (this.getUpdateDt() != null)
277 {
278 cmp = (cmp != 0 ? cmp : this.getUpdateDt().compareTo(o.getUpdateDt()));
279 }
280 }
281 return cmp;
282 }
283 // HibernateEntity.vsl merge-point
284 // MapProject.java merge-point
285 }