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.administration.metaprogamme;
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 java.io.Serializable;
30 import java.sql.Timestamp;
31 import java.util.Collection;
32 import java.util.HashSet;
33
34 /**
35 * Liste des lieux d'un métaprogramme
36 */
37 // HibernateEntity.vsl annotations merge-point
38 public abstract class MonLocMet
39 implements Serializable, Comparable<MonLocMet>
40 {
41 /**
42 * The serial version UID of this class. Needed for serialization.
43 */
44 private static final long serialVersionUID = 4669194959258532954L;
45
46 // Generate 2 attributes
47 private Timestamp updateDt;
48
49 /**
50 * Date de modification de l'objet, mise à jour par le système
51 * @return this.updateDt Timestamp
52 */
53 public Timestamp getUpdateDt()
54 {
55 return this.updateDt;
56 }
57
58 /**
59 * Date de modification de l'objet, mise à jour par le système
60 * @param updateDtIn Timestamp
61 */
62 public void setUpdateDt(Timestamp updateDtIn)
63 {
64 this.updateDt = updateDtIn;
65 }
66
67 private Integer monLocMetId;
68
69 /**
70 *
71 * @return this.monLocMetId Integer
72 */
73 public Integer getMonLocMetId()
74 {
75 return this.monLocMetId;
76 }
77
78 /**
79 *
80 * @param monLocMetIdIn Integer
81 */
82 public void setMonLocMetId(Integer monLocMetIdIn)
83 {
84 this.monLocMetId = monLocMetIdIn;
85 }
86
87 // Generate 3 associations
88 private Collection<PmfmMet> pmfmMets = new HashSet<PmfmMet>();
89
90 /**
91 * Liste des PMFM ou éléments constitutifs associés à un programme
92 * @return this.pmfmMets Collection<PmfmMet>
93 */
94 public Collection<PmfmMet> getPmfmMets()
95 {
96 return this.pmfmMets;
97 }
98
99 /**
100 * Liste des PMFM ou éléments constitutifs associés à un programme
101 * @param pmfmMetsIn Collection<PmfmMet>
102 */
103 public void setPmfmMets(Collection<PmfmMet> pmfmMetsIn)
104 {
105 this.pmfmMets = pmfmMetsIn;
106 }
107
108 /**
109 * Liste des PMFM ou éléments constitutifs associés à un programme
110 * @param elementToAdd PmfmMet
111 * @return <tt>true</tt> if this collection changed as a result of the
112 * call
113 */
114 public boolean addPmfmMets(PmfmMet elementToAdd)
115 {
116 return this.pmfmMets.add(elementToAdd);
117 }
118
119 /**
120 * Liste des PMFM ou éléments constitutifs associés à un programme
121 * @param elementToRemove PmfmMet
122 * @return <tt>true</tt> if this collection changed as a result of the
123 * call
124 */
125 public boolean removePmfmMets(PmfmMet elementToRemove)
126 {
127 return this.pmfmMets.remove(elementToRemove);
128 }
129
130 private MonitoringLocation monitoringLocation;
131
132 /**
133 * Liste les lieux associés aux programmes de surveillance.
134 * @return this.monitoringLocation MonitoringLocation
135 */
136 public MonitoringLocation getMonitoringLocation()
137 {
138 return this.monitoringLocation;
139 }
140
141 /**
142 * Liste les lieux associés aux programmes de surveillance.
143 * @param monitoringLocationIn MonitoringLocation
144 */
145 public void setMonitoringLocation(MonitoringLocation monitoringLocationIn)
146 {
147 this.monitoringLocation = monitoringLocationIn;
148 }
149
150 private Metaprogramme metaprogramme;
151
152 /**
153 * Programme virtuel (métaprogramme)
154 * @return this.metaprogramme Metaprogramme
155 */
156 public Metaprogramme getMetaprogramme()
157 {
158 return this.metaprogramme;
159 }
160
161 /**
162 * Programme virtuel (métaprogramme)
163 * @param metaprogrammeIn Metaprogramme
164 */
165 public void setMetaprogramme(Metaprogramme metaprogrammeIn)
166 {
167 this.metaprogramme = metaprogrammeIn;
168 }
169
170 /**
171 * Returns <code>true</code> if the argument is an MonLocMet instance and all identifiers for this entity
172 * equal the identifiers of the argument entity. Returns <code>false</code> otherwise.
173 */
174 @Override
175 public boolean equals(Object object)
176 {
177 if (this == object)
178 {
179 return true;
180 }
181 if (!(object instanceof MonLocMet))
182 {
183 return false;
184 }
185 final MonLocMet that = (MonLocMet)object;
186 if (this.monLocMetId == null || that.getMonLocMetId() == null || !this.monLocMetId.equals(that.getMonLocMetId()))
187 {
188 return false;
189 }
190 return true;
191 }
192
193 /**
194 * Returns a hash code based on this entity's identifiers.
195 */
196 @Override
197 public int hashCode()
198 {
199 int hashCode = 0;
200 hashCode = 29 * hashCode + (this.monLocMetId == null ? 0 : this.monLocMetId.hashCode());
201
202 return hashCode;
203 }
204
205 /**
206 * Constructs new instances of {@link MonLocMet}.
207 */
208 public static final class Factory
209 {
210 /**
211 * Constructs a new instance of {@link MonLocMet}.
212 * @return new MonLocMetImpl()
213 */
214 public static MonLocMet newInstance()
215 {
216 return new MonLocMetImpl();
217 }
218
219 /**
220 * Constructs a new instance of {@link MonLocMet}, taking all required and/or
221 * read-only properties as arguments, except for identifiers.
222 * @param monitoringLocation MonitoringLocation
223 * @param metaprogramme Metaprogramme
224 * @return newInstance
225 */
226 public static MonLocMet newInstance(MonitoringLocation monitoringLocation, Metaprogramme metaprogramme)
227 {
228 final MonLocMet entity = new MonLocMetImpl();
229 entity.setMonitoringLocation(monitoringLocation);
230 entity.setMetaprogramme(metaprogramme);
231 return entity;
232 }
233
234 /**
235 * Constructs a new instance of {@link MonLocMet}, taking all possible properties
236 * (except the identifier(s))as arguments.
237 * @param updateDt Timestamp
238 * @param pmfmMets Collection<PmfmMet>
239 * @param monitoringLocation MonitoringLocation
240 * @param metaprogramme Metaprogramme
241 * @return newInstance MonLocMet
242 */
243 public static MonLocMet newInstance(Timestamp updateDt, Collection<PmfmMet> pmfmMets, MonitoringLocation monitoringLocation, Metaprogramme metaprogramme)
244 {
245 final MonLocMet entity = new MonLocMetImpl();
246 entity.setUpdateDt(updateDt);
247 entity.setPmfmMets(pmfmMets);
248 entity.setMonitoringLocation(monitoringLocation);
249 entity.setMetaprogramme(metaprogramme);
250 return entity;
251 }
252 }
253
254 /**
255 * @see Comparable#compareTo
256 */
257 public int compareTo(MonLocMet o)
258 {
259 int cmp = 0;
260 if (this.getMonLocMetId() != null)
261 {
262 cmp = this.getMonLocMetId().compareTo(o.getMonLocMetId());
263 }
264 else
265 {
266 if (this.getUpdateDt() != null)
267 {
268 cmp = (cmp != 0 ? cmp : this.getUpdateDt().compareTo(o.getUpdateDt()));
269 }
270 }
271 return cmp;
272 }
273 // HibernateEntity.vsl merge-point
274 // MonLocMet.java merge-point
275 }