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.pmfm;
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 java.io.Serializable;
033import java.sql.Timestamp;
034import java.util.Date;
035
036/**
037 * Les méthodes sont rassemblées dans une liste qui couvre tous les domaines pour lesquels il existe
038 * un paramètre.
039 * La liste des méthodes est générique et porte sur toutes les phases du processus de mesure des
040 * paramètres. Chaque méthode n'est pas non plus systématiquement spécifique à l'une de ces phases
041 * ou à une nature particulière de paramètre. En effet, une méthode peut couvrir tout le cycle du
042 * processus et/ou être utilisable pour une phase quelle que soit la nature du paramètre.
043 * Les méthodes peuvent être référencées par les paramètres à différentes phases de leur processus
044 * de mesure que sont :
045 * pour les paramètres biologique :
046 * - le prélèvement et l'échantillonnage ;
047 * - la conservation et le transport ;
048 * - le fractionnement ;
049 * - l'analyse ;
050 * pour les paramètres environnementaux :
051 * - l'observation ;
052 */
053// HibernateEntity.vsl annotations merge-point
054public abstract class Method
055    implements Serializable, Comparable<Method>
056{
057    /**
058     * The serial version UID of this class. Needed for serialization.
059     */
060    private static final long serialVersionUID = 6161971094760201154L;
061
062    // Generate 11 attributes
063    private Integer id;
064
065    /**
066     * Identifiant unique de la méthode.Généré par le système.
067     * @return this.id Integer
068     */
069    public Integer getId()
070    {
071        return this.id;
072    }
073
074    /**
075     * Identifiant unique de la méthode.Généré par le système.
076     * @param idIn Integer
077     */
078    public void setId(Integer idIn)
079    {
080        this.id = idIn;
081    }
082
083    private String name;
084
085    /**
086     * Description courte de la méthode.
087     * @return this.name String
088     */
089    public String getName()
090    {
091        return this.name;
092    }
093
094    /**
095     * Description courte de la méthode.
096     * @param nameIn String
097     */
098    public void setName(String nameIn)
099    {
100        this.name = nameIn;
101    }
102
103    private String description;
104
105    /**
106     * Description longue de la méthode.
107     * @return this.description String
108     */
109    public String getDescription()
110    {
111        return this.description;
112    }
113
114    /**
115     * Description longue de la méthode.
116     * @param descriptionIn String
117     */
118    public void setDescription(String descriptionIn)
119    {
120        this.description = descriptionIn;
121    }
122
123    private String conditioning;
124
125    /**
126     * Description du conditionnement des échantillons ou des prélèvements en vue de leur analyse.
127     * @return this.conditioning String
128     */
129    public String getConditioning()
130    {
131        return this.conditioning;
132    }
133
134    /**
135     * Description du conditionnement des échantillons ou des prélèvements en vue de leur analyse.
136     * @param conditioningIn String
137     */
138    public void setConditioning(String conditioningIn)
139    {
140        this.conditioning = conditioningIn;
141    }
142
143    private String preparation;
144
145    /**
146     * Description de la préparation des échantillons ou des prélèvements en vue de leur analyse.
147     * @return this.preparation String
148     */
149    public String getPreparation()
150    {
151        return this.preparation;
152    }
153
154    /**
155     * Description de la préparation des échantillons ou des prélèvements en vue de leur analyse.
156     * @param preparationIn String
157     */
158    public void setPreparation(String preparationIn)
159    {
160        this.preparation = preparationIn;
161    }
162
163    private String conservation;
164
165    /**
166     * Description de la méthode de conservation des échantillons ou des prélèvements en vue de leur
167     * analyse.
168     * @return this.conservation String
169     */
170    public String getConservation()
171    {
172        return this.conservation;
173    }
174
175    /**
176     * Description de la méthode de conservation des échantillons ou des prélèvements en vue de leur
177     * analyse.
178     * @param conservationIn String
179     */
180    public void setConservation(String conservationIn)
181    {
182        this.conservation = conservationIn;
183    }
184
185    private String reference;
186
187    /**
188     * Référence nationale ou internationale de la méthode.
189     * Référence à l'origine de la méthode.
190     * Par exemple :
191     * - "Bradford M., 1976. A rapid method for quantification of protein utilizing the principle of
192     * dye binding. Anal. Biochem. 72 : 248-264"
193     * - "Circulaire 1988 Mer/Agriculture"
194     * Nombre de lignes : 500
195     * @return this.reference String
196     */
197    public String getReference()
198    {
199        return this.reference;
200    }
201
202    /**
203     * Référence nationale ou internationale de la méthode.
204     * Référence à l'origine de la méthode.
205     * Par exemple :
206     * - "Bradford M., 1976. A rapid method for quantification of protein utilizing the principle of
207     * dye binding. Anal. Biochem. 72 : 248-264"
208     * - "Circulaire 1988 Mer/Agriculture"
209     * Nombre de lignes : 500
210     * @param referenceIn String
211     */
212    public void setReference(String referenceIn)
213    {
214        this.reference = referenceIn;
215    }
216
217    private String rank;
218
219    /**
220     * Numéro de la méthode pour pouvoir "chainer" les méthodes. Il est saisi par l'administrateur.
221     * @return this.rank String
222     */
223    public String getRank()
224    {
225        return this.rank;
226    }
227
228    /**
229     * Numéro de la méthode pour pouvoir "chainer" les méthodes. Il est saisi par l'administrateur.
230     * @param rankIn String
231     */
232    public void setRank(String rankIn)
233    {
234        this.rank = rankIn;
235    }
236
237    private String handbookPath;
238
239    /**
240     * Lien vers un fichier PDF décrivant plus précisemment la méthode.
241     * @return this.handbookPath String
242     */
243    public String getHandbookPath()
244    {
245        return this.handbookPath;
246    }
247
248    /**
249     * Lien vers un fichier PDF décrivant plus précisemment la méthode.
250     * @param handbookPathIn String
251     */
252    public void setHandbookPath(String handbookPathIn)
253    {
254        this.handbookPath = handbookPathIn;
255    }
256
257    private Date creationDate;
258
259    /**
260     * Date système de création de la méthode. Cette date est renseignée automatiquement.
261     * @return this.creationDate Date
262     */
263    public Date getCreationDate()
264    {
265        return this.creationDate;
266    }
267
268    /**
269     * Date système de création de la méthode. Cette date est renseignée automatiquement.
270     * @param creationDateIn Date
271     */
272    public void setCreationDate(Date creationDateIn)
273    {
274        this.creationDate = creationDateIn;
275    }
276
277    private Timestamp updateDate;
278
279    /**
280     * Date de mise à jour de création de la méthode. Cette date est renseignée automatiquement.
281     * @return this.updateDate Timestamp
282     */
283    public Timestamp getUpdateDate()
284    {
285        return this.updateDate;
286    }
287
288    /**
289     * Date de mise à jour de création de la méthode. Cette date est renseignée automatiquement.
290     * @param updateDateIn Timestamp
291     */
292    public void setUpdateDate(Timestamp updateDateIn)
293    {
294        this.updateDate = updateDateIn;
295    }
296
297    // Generate 4 associations
298    private Status status;
299
300    /**
301     * Pour les données du référentiel, information permettant de déterminer si une donnée est
302     * valide,
303     * obsolète ou temporaire.
304     * - obsolète (=inactif) : '0'
305     * - valide (=actif) : '1'
306     * - temporaire : '2'
307     * - en cours de suppression : '3'
308     * -  : '4'
309     * note : on a préfère ici 'valide' au terme 'actif' (utilisé dans Harmonie), pour ne pas
310     * confondre
311     * avec par exemple l'activité d'un navire sur un mois.
312     * @return this.status Status
313     */
314    public Status getStatus()
315    {
316        return this.status;
317    }
318
319    /**
320     * Pour les données du référentiel, information permettant de déterminer si une donnée est
321     * valide,
322     * obsolète ou temporaire.
323     * - obsolète (=inactif) : '0'
324     * - valide (=actif) : '1'
325     * - temporaire : '2'
326     * - en cours de suppression : '3'
327     * -  : '4'
328     * note : on a préfère ici 'valide' au terme 'actif' (utilisé dans Harmonie), pour ne pas
329     * confondre
330     * avec par exemple l'activité d'un navire sur un mois.
331     * @param statusIn Status
332     */
333    public void setStatus(Status statusIn)
334    {
335        this.status = statusIn;
336    }
337
338    /**
339     * Returns <code>true</code> if the argument is an Method instance and all identifiers for this entity
340     * equal the identifiers of the argument entity. Returns <code>false</code> otherwise.
341     */
342    @Override
343    public boolean equals(Object object)
344    {
345        if (this == object)
346        {
347            return true;
348        }
349        if (!(object instanceof Method))
350        {
351            return false;
352        }
353        final Method that = (Method)object;
354        if (this.id == null || that.getId() == null || !this.id.equals(that.getId()))
355        {
356            return false;
357        }
358        return true;
359    }
360
361    /**
362     * Returns a hash code based on this entity's identifiers.
363     */
364    @Override
365    public int hashCode()
366    {
367        int hashCode = 0;
368        hashCode = 29 * hashCode + (this.id == null ? 0 : this.id.hashCode());
369
370        return hashCode;
371    }
372
373    /**
374     * Constructs new instances of {@link Method}.
375     */
376    public static final class Factory
377    {
378        /**
379         * Constructs a new instance of {@link Method}.
380         * @return new MethodImpl()
381         */
382        public static Method newInstance()
383        {
384            return new MethodImpl();
385        }
386
387        /**
388         * Constructs a new instance of {@link Method}, taking all required and/or
389         * read-only properties as arguments, except for identifiers.
390         * @param name String
391         * @param rank String
392         * @param creationDate Date
393         * @param updateDate Timestamp
394         * @param status Status
395         * @return newInstance
396         */
397        public static Method newInstance(String name, String rank, Date creationDate, Timestamp updateDate, Status status)
398        {
399            final Method entity = new MethodImpl();
400            entity.setName(name);
401            entity.setRank(rank);
402            entity.setCreationDate(creationDate);
403            entity.setUpdateDate(updateDate);
404            entity.setStatus(status);
405            return entity;
406        }
407
408        /**
409         * Constructs a new instance of {@link Method}, taking all possible properties
410         * (except the identifier(s))as arguments.
411         * @param name String
412         * @param description String
413         * @param conditioning String
414         * @param preparation String
415         * @param conservation String
416         * @param reference String
417         * @param rank String
418         * @param handbookPath String
419         * @param creationDate Date
420         * @param updateDate Timestamp
421         * @param status Status
422         * @return newInstance Method
423         */
424        public static Method newInstance(String name, String description, String conditioning, String preparation, String conservation, String reference, String rank, String handbookPath, Date creationDate, Timestamp updateDate, Status status)
425        {
426            final Method entity = new MethodImpl();
427            entity.setName(name);
428            entity.setDescription(description);
429            entity.setConditioning(conditioning);
430            entity.setPreparation(preparation);
431            entity.setConservation(conservation);
432            entity.setReference(reference);
433            entity.setRank(rank);
434            entity.setHandbookPath(handbookPath);
435            entity.setCreationDate(creationDate);
436            entity.setUpdateDate(updateDate);
437            entity.setStatus(status);
438            return entity;
439        }
440    }
441
442    /**
443     * @see Comparable#compareTo
444     */
445    public int compareTo(Method o)
446    {
447        int cmp = 0;
448        if (this.getId() != null)
449        {
450            cmp = this.getId().compareTo(o.getId());
451        }
452        else
453        {
454            if (this.getName() != null)
455            {
456                cmp = (cmp != 0 ? cmp : this.getName().compareTo(o.getName()));
457            }
458            if (this.getDescription() != null)
459            {
460                cmp = (cmp != 0 ? cmp : this.getDescription().compareTo(o.getDescription()));
461            }
462            if (this.getConditioning() != null)
463            {
464                cmp = (cmp != 0 ? cmp : this.getConditioning().compareTo(o.getConditioning()));
465            }
466            if (this.getPreparation() != null)
467            {
468                cmp = (cmp != 0 ? cmp : this.getPreparation().compareTo(o.getPreparation()));
469            }
470            if (this.getConservation() != null)
471            {
472                cmp = (cmp != 0 ? cmp : this.getConservation().compareTo(o.getConservation()));
473            }
474            if (this.getReference() != null)
475            {
476                cmp = (cmp != 0 ? cmp : this.getReference().compareTo(o.getReference()));
477            }
478            if (this.getRank() != null)
479            {
480                cmp = (cmp != 0 ? cmp : this.getRank().compareTo(o.getRank()));
481            }
482            if (this.getHandbookPath() != null)
483            {
484                cmp = (cmp != 0 ? cmp : this.getHandbookPath().compareTo(o.getHandbookPath()));
485            }
486            if (this.getCreationDate() != null)
487            {
488                cmp = (cmp != 0 ? cmp : this.getCreationDate().compareTo(o.getCreationDate()));
489            }
490            if (this.getUpdateDate() != null)
491            {
492                cmp = (cmp != 0 ? cmp : this.getUpdateDate().compareTo(o.getUpdateDate()));
493            }
494        }
495        return cmp;
496    }
497// HibernateEntity.vsl merge-point
498// Method.java merge-point
499}