001// license-header java merge-point
002//
003// Attention: Generated code! Do not modify by hand!
004// Generated by: hibernate/HibernateEntity.vsl in andromda-hibernate-cartridge.
005//
006package fr.ifremer.adagio.core.dao.referential.location;
007
008/*
009 * #%L
010 * SIH-Adagio :: Core
011 * $Id:$
012 * $HeadURL:$
013 * %%
014 * Copyright (C) 2012 - 2014 Ifremer
015 * %%
016 * This program is free software: you can redistribute it and/or modify
017 * it under the terms of the GNU Affero General Public License as published by
018 * the Free Software Foundation, either version 3 of the License, or
019 * (at your option) any later version.
020 * 
021 * This program is distributed in the hope that it will be useful,
022 * but WITHOUT ANY WARRANTY; without even the implied warranty of
023 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
024 * GNU General Public License for more details.
025 * 
026 * You should have received a copy of the GNU Affero General Public License
027 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
028 * #L%
029 */
030
031import fr.ifremer.adagio.core.dao.referential.Status;
032import fr.ifremer.adagio.core.dao.referential.ValidityStatus;
033import java.io.Serializable;
034import java.sql.Timestamp;
035
036/**
037 * Représente un lieu au sens général du terme. Il peut s'agir d'un lieu ponctuel, linéaire ou
038 * surfacique.
039 * Suivant sa classification et son niveau, il peut s'agir d'un secteur FAO, un port de pêche, un
040 * quartier maritime, une criée, etc.
041 * Nombre de lignes : lieux terrestre : 4500 + secteurs : 11210 + strates : 1000 + localités : 200
042 */
043// HibernateEntity.vsl annotations merge-point
044public abstract class Location
045    implements Serializable, Comparable<Location>
046{
047    /**
048     * The serial version UID of this class. Needed for serialization.
049     */
050    private static final long serialVersionUID = -228843571641414494L;
051
052    // Generate 8 attributes
053    private Integer id;
054
055    /**
056     * Identifiant unique du lieu. Généré par le système.
057     * @return this.id Integer
058     */
059    public Integer getId()
060    {
061        return this.id;
062    }
063
064    /**
065     * Identifiant unique du lieu. Généré par le système.
066     * @param idIn Integer
067     */
068    public void setId(Integer idIn)
069    {
070        this.id = idIn;
071    }
072
073    private String label;
074
075    /**
076     * Code du lieuExemple : pour les ports : BR, SB
077     * @return this.label String
078     */
079    public String getLabel()
080    {
081        return this.label;
082    }
083
084    /**
085     * Code du lieuExemple : pour les ports : BR, SB
086     * @param labelIn String
087     */
088    public void setLabel(String labelIn)
089    {
090        this.label = labelIn;
091    }
092
093    private String name;
094
095    /**
096     * Libellé du lieu
097     * @return this.name String
098     */
099    public String getName()
100    {
101        return this.name;
102    }
103
104    /**
105     * Libellé du lieu
106     * @param nameIn String
107     */
108    public void setName(String nameIn)
109    {
110        this.name = nameIn;
111    }
112
113    private Float bathymetry;
114
115    /**
116     * Valeur de la bathymétrie sur le lieu (optionnel). La bathymétrie peut être positive ou
117     * négative.
118     * @return this.bathymetry Float
119     */
120    public Float getBathymetry()
121    {
122        return this.bathymetry;
123    }
124
125    /**
126     * Valeur de la bathymétrie sur le lieu (optionnel). La bathymétrie peut être positive ou
127     * négative.
128     * @param bathymetryIn Float
129     */
130    public void setBathymetry(Float bathymetryIn)
131    {
132        this.bathymetry = bathymetryIn;
133    }
134
135    private Short utFormat;
136
137    /**
138     * Format UT (Universal Time) de l'heure pour le lieu (0, +1, -4...).
139     * En France métropolitaine, par exemple : +1 (= heure Europe/Paris)
140     * @return this.utFormat Short
141     */
142    public Short getUtFormat()
143    {
144        return this.utFormat;
145    }
146
147    /**
148     * Format UT (Universal Time) de l'heure pour le lieu (0, +1, -4...).
149     * En France métropolitaine, par exemple : +1 (= heure Europe/Paris)
150     * @param utFormatIn Short
151     */
152    public void setUtFormat(Short utFormatIn)
153    {
154        this.utFormat = utFormatIn;
155    }
156
157    private Boolean daylightSavingTime;
158
159    /**
160     * Indique s'il faut opérer le changement d'heure hiver-été, vrai par défaut.
161     * En France métropolitaine, par exemple : Vrai.
162     * @return this.daylightSavingTime Boolean
163     */
164    public Boolean getDaylightSavingTime()
165    {
166        return this.daylightSavingTime;
167    }
168
169    /**
170     * Indique s'il faut opérer le changement d'heure hiver-été, vrai par défaut.
171     * En France métropolitaine, par exemple : Vrai.
172     * @param daylightSavingTimeIn Boolean
173     */
174    public void setDaylightSavingTime(Boolean daylightSavingTimeIn)
175    {
176        this.daylightSavingTime = daylightSavingTimeIn;
177    }
178
179    private String comments;
180
181    /**
182     * 
183     * @return this.comments String
184     */
185    public String getComments()
186    {
187        return this.comments;
188    }
189
190    /**
191     * 
192     * @param commentsIn String
193     */
194    public void setComments(String commentsIn)
195    {
196        this.comments = commentsIn;
197    }
198
199    private Timestamp updateDate;
200
201    /**
202     * 
203     * @return this.updateDate Timestamp
204     */
205    public Timestamp getUpdateDate()
206    {
207        return this.updateDate;
208    }
209
210    /**
211     * 
212     * @param updateDateIn Timestamp
213     */
214    public void setUpdateDate(Timestamp updateDateIn)
215    {
216        this.updateDate = updateDateIn;
217    }
218
219    // Generate 53 associations
220    private ValidityStatus validityStatus;
221
222    /**
223     * Etat de validation d'une donnée du référentiel. Utile pour les responsables de référentiel.
224     * Validity status of a referential data.
225     * @return this.validityStatus ValidityStatus
226     */
227    public ValidityStatus getValidityStatus()
228    {
229        return this.validityStatus;
230    }
231
232    /**
233     * Etat de validation d'une donnée du référentiel. Utile pour les responsables de référentiel.
234     * Validity status of a referential data.
235     * @param validityStatusIn ValidityStatus
236     */
237    public void setValidityStatus(ValidityStatus validityStatusIn)
238    {
239        this.validityStatus = validityStatusIn;
240    }
241
242    private LocationClassification locationClassification;
243
244    /**
245     * Classification de lieu duquel dépend le lieu (doit être identique à celle du niveau de lieu)
246     * @return this.locationClassification LocationClassification
247     */
248    public LocationClassification getLocationClassification()
249    {
250        return this.locationClassification;
251    }
252
253    /**
254     * Classification de lieu duquel dépend le lieu (doit être identique à celle du niveau de lieu)
255     * @param locationClassificationIn LocationClassification
256     */
257    public void setLocationClassification(LocationClassification locationClassificationIn)
258    {
259        this.locationClassification = locationClassificationIn;
260    }
261
262    private LocationLevel locationLevel;
263
264    /**
265     * Niveau de lieu, ou catégorie. Il s'agit d'un regroupement de haut niveau d'un ensemble de
266     * lieux de
267     * meme nature géographique.
268     * Par exemple, pour la classification de lieu "Secteur maritime", on aura :
269     * - Zone FAO,
270     * - Sous-Zone FAO,
271     * - Division CIEM,
272     * - Sous-division CIEM
273     * - etc.
274     * Pour la classification de lieu "lieux territoriaux", on aura :
275     * - Pays
276     * - Region,
277     * - Département,
278     * - Quartier Maritme,
279     * - Port
280     * - ...
281     * On pourra trouver d'autre niveau de lieu, comme :
282     * - implantation Ifremer
283     * - laboratoire côtier, ...
284     * @return this.locationLevel LocationLevel
285     */
286    public LocationLevel getLocationLevel()
287    {
288        return this.locationLevel;
289    }
290
291    /**
292     * Niveau de lieu, ou catégorie. Il s'agit d'un regroupement de haut niveau d'un ensemble de
293     * lieux de
294     * meme nature géographique.
295     * Par exemple, pour la classification de lieu "Secteur maritime", on aura :
296     * - Zone FAO,
297     * - Sous-Zone FAO,
298     * - Division CIEM,
299     * - Sous-division CIEM
300     * - etc.
301     * Pour la classification de lieu "lieux territoriaux", on aura :
302     * - Pays
303     * - Region,
304     * - Département,
305     * - Quartier Maritme,
306     * - Port
307     * - ...
308     * On pourra trouver d'autre niveau de lieu, comme :
309     * - implantation Ifremer
310     * - laboratoire côtier, ...
311     * @param locationLevelIn LocationLevel
312     */
313    public void setLocationLevel(LocationLevel locationLevelIn)
314    {
315        this.locationLevel = locationLevelIn;
316    }
317
318    private Status status;
319
320    /**
321     * Pour les données du référentiel, information permettant de déterminer si une donnée est
322     * valide,
323     * obsolète ou temporaire.
324     * - obsolète (=inactif) : '0'
325     * - valide (=actif) : '1'
326     * - temporaire : '2'
327     * - en cours de suppression : '3'
328     * -  : '4'
329     * note : on a préfère ici 'valide' au terme 'actif' (utilisé dans Harmonie), pour ne pas
330     * confondre
331     * avec par exemple l'activité d'un navire sur un mois.
332     * @return this.status Status
333     */
334    public Status getStatus()
335    {
336        return this.status;
337    }
338
339    /**
340     * Pour les données du référentiel, information permettant de déterminer si une donnée est
341     * valide,
342     * obsolète ou temporaire.
343     * - obsolète (=inactif) : '0'
344     * - valide (=actif) : '1'
345     * - temporaire : '2'
346     * - en cours de suppression : '3'
347     * -  : '4'
348     * note : on a préfère ici 'valide' au terme 'actif' (utilisé dans Harmonie), pour ne pas
349     * confondre
350     * avec par exemple l'activité d'un navire sur un mois.
351     * @param statusIn Status
352     */
353    public void setStatus(Status statusIn)
354    {
355        this.status = statusIn;
356    }
357
358    /**
359     * Returns <code>true</code> if the argument is an Location instance and all identifiers for this entity
360     * equal the identifiers of the argument entity. Returns <code>false</code> otherwise.
361     */
362    @Override
363    public boolean equals(Object object)
364    {
365        if (this == object)
366        {
367            return true;
368        }
369        if (!(object instanceof Location))
370        {
371            return false;
372        }
373        final Location that = (Location)object;
374        if (this.id == null || that.getId() == null || !this.id.equals(that.getId()))
375        {
376            return false;
377        }
378        return true;
379    }
380
381    /**
382     * Returns a hash code based on this entity's identifiers.
383     */
384    @Override
385    public int hashCode()
386    {
387        int hashCode = 0;
388        hashCode = 29 * hashCode + (this.id == null ? 0 : this.id.hashCode());
389
390        return hashCode;
391    }
392
393    /**
394     * Constructs new instances of {@link Location}.
395     */
396    public static final class Factory
397    {
398        /**
399         * Constructs a new instance of {@link Location}.
400         * @return new LocationImpl()
401         */
402        public static Location newInstance()
403        {
404            return new LocationImpl();
405        }
406
407        /**
408         * Constructs a new instance of {@link Location}, taking all required and/or
409         * read-only properties as arguments, except for identifiers.
410         * @param name String
411         * @param updateDate Timestamp
412         * @param validityStatus ValidityStatus
413         * @param locationClassification LocationClassification
414         * @param locationLevel LocationLevel
415         * @param status Status
416         * @return newInstance
417         */
418        public static Location newInstance(String name, Timestamp updateDate, ValidityStatus validityStatus, LocationClassification locationClassification, LocationLevel locationLevel, Status status)
419        {
420            final Location entity = new LocationImpl();
421            entity.setName(name);
422            entity.setUpdateDate(updateDate);
423            entity.setValidityStatus(validityStatus);
424            entity.setLocationClassification(locationClassification);
425            entity.setLocationLevel(locationLevel);
426            entity.setStatus(status);
427            return entity;
428        }
429
430        /**
431         * Constructs a new instance of {@link Location}, taking all possible properties
432         * (except the identifier(s))as arguments.
433         * @param label String
434         * @param name String
435         * @param bathymetry Float
436         * @param utFormat Short
437         * @param daylightSavingTime Boolean
438         * @param comments String
439         * @param updateDate Timestamp
440         * @param validityStatus ValidityStatus
441         * @param locationClassification LocationClassification
442         * @param locationLevel LocationLevel
443         * @param status Status
444         * @return newInstance Location
445         */
446        public static Location newInstance(String label, String name, Float bathymetry, Short utFormat, Boolean daylightSavingTime, String comments, Timestamp updateDate, ValidityStatus validityStatus, LocationClassification locationClassification, LocationLevel locationLevel, Status status)
447        {
448            final Location entity = new LocationImpl();
449            entity.setLabel(label);
450            entity.setName(name);
451            entity.setBathymetry(bathymetry);
452            entity.setUtFormat(utFormat);
453            entity.setDaylightSavingTime(daylightSavingTime);
454            entity.setComments(comments);
455            entity.setUpdateDate(updateDate);
456            entity.setValidityStatus(validityStatus);
457            entity.setLocationClassification(locationClassification);
458            entity.setLocationLevel(locationLevel);
459            entity.setStatus(status);
460            return entity;
461        }
462    }
463
464    /**
465     * @see Comparable#compareTo
466     */
467    public int compareTo(Location o)
468    {
469        int cmp = 0;
470        if (this.getId() != null)
471        {
472            cmp = this.getId().compareTo(o.getId());
473        }
474        else
475        {
476            if (this.getLabel() != null)
477            {
478                cmp = (cmp != 0 ? cmp : this.getLabel().compareTo(o.getLabel()));
479            }
480            if (this.getName() != null)
481            {
482                cmp = (cmp != 0 ? cmp : this.getName().compareTo(o.getName()));
483            }
484            if (this.getBathymetry() != null)
485            {
486                cmp = (cmp != 0 ? cmp : this.getBathymetry().compareTo(o.getBathymetry()));
487            }
488            if (this.getUtFormat() != null)
489            {
490                cmp = (cmp != 0 ? cmp : this.getUtFormat().compareTo(o.getUtFormat()));
491            }
492            if (this.getDaylightSavingTime() != null)
493            {
494                cmp = (cmp != 0 ? cmp : this.getDaylightSavingTime().compareTo(o.getDaylightSavingTime()));
495            }
496            if (this.getComments() != null)
497            {
498                cmp = (cmp != 0 ? cmp : this.getComments().compareTo(o.getComments()));
499            }
500            if (this.getUpdateDate() != null)
501            {
502                cmp = (cmp != 0 ? cmp : this.getUpdateDate().compareTo(o.getUpdateDate()));
503            }
504        }
505        return cmp;
506    }
507// HibernateEntity.vsl merge-point
508// Location.java merge-point
509}