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.conversion;
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.OriginItemType;
032import fr.ifremer.adagio.core.dao.referential.Status;
033import fr.ifremer.adagio.core.dao.referential.location.Location;
034import fr.ifremer.adagio.core.dao.referential.pmfm.Parameter;
035import fr.ifremer.adagio.core.dao.referential.pmfm.QualitativeValue;
036import fr.ifremer.adagio.core.dao.referential.pmfm.Unit;
037import fr.ifremer.adagio.core.dao.referential.taxon.ReferenceTaxon;
038import java.io.Serializable;
039import java.sql.Timestamp;
040
041/**
042 * <html>
043 * <head>
044 * </head>
045 * <body>
046 * <p>
047 * <b>Relation Taille poids</b> :<br><br>
048 * </p>
049 * <p>
050 * Le calcul se fait par multiplication de la taille d&#8217;un poisson par un
051 * coefficient multiplicateur (convCoeff). Ce coefficient est obtenu &#224;
052 * partir des caract&#233;ristiques suivantes<br>- Taxon mesur&#233; (=esp&#232;ces
053 * scientifiques) : ReferenceTaxon<br>- P&#233;riode (ex : du mois de &quot;d&#233;cembre&quot;
054 * au mois de &quot;juillet&quot;, ind&#233;pendant de l'ann&#233;e): startMonth, endMonth<br>-
055 * Lieu ( Lieu p&#232;re si inexistant).<br>- Sexe. Cette caract&#233;ristique
056 * n&#8217;&#233;tant pas renseign&#233;e syst&#233;matiquement dans la table de correspondance,
057 * la recherche du coefficient doit d&#8217;abord s&#8217;effectuer sur les
058 * coefficients ind&#233;pendant du sexe (Sex=null ). Si cette recherche est
059 * infructueuse, et si le sexe du lot est connu (crit&#232;re de classement
060 * &#8216;sexe&#8217; renseign&#233;) une nouvelle recherche doit &#234;tre lanc&#233;e sur les
061 * coefficients ayant le sexe du lot consid&#233;r&#233;
062 * </p>
063 * </body>
064 * </html>
065 */
066// HibernateEntity.vsl annotations merge-point
067public abstract class WeightLengthConversion
068    implements Serializable, Comparable<WeightLengthConversion>
069{
070    /**
071     * The serial version UID of this class. Needed for serialization.
072     */
073    private static final long serialVersionUID = 7574566403831648005L;
074
075    // Generate 9 attributes
076    private Integer id;
077
078    /**
079     * Idenfiant interne. Généré par le système.
080     * @return this.id Integer
081     */
082    public Integer getId()
083    {
084        return this.id;
085    }
086
087    /**
088     * Idenfiant interne. Généré par le système.
089     * @param idIn Integer
090     */
091    public void setId(Integer idIn)
092    {
093        this.id = idIn;
094    }
095
096    private Double conversionCoefficientA;
097
098    /**
099     * Coefficient A de le relation taille/poids.
100     * @return this.conversionCoefficientA Double
101     */
102    public Double getConversionCoefficientA()
103    {
104        return this.conversionCoefficientA;
105    }
106
107    /**
108     * Coefficient A de le relation taille/poids.
109     * @param conversionCoefficientAIn Double
110     */
111    public void setConversionCoefficientA(Double conversionCoefficientAIn)
112    {
113        this.conversionCoefficientA = conversionCoefficientAIn;
114    }
115
116    private Double conversionCoefficientB;
117
118    /**
119     * Coefficient B de le relation taille/poids.
120     * @return this.conversionCoefficientB Double
121     */
122    public Double getConversionCoefficientB()
123    {
124        return this.conversionCoefficientB;
125    }
126
127    /**
128     * Coefficient B de le relation taille/poids.
129     * @param conversionCoefficientBIn Double
130     */
131    public void setConversionCoefficientB(Double conversionCoefficientBIn)
132    {
133        this.conversionCoefficientB = conversionCoefficientBIn;
134    }
135
136    private Integer startMonth;
137
138    /**
139     * Premier mois de l'année (inclus) à partir duquel la conversion s'applique.
140     * @return this.startMonth Integer
141     */
142    public Integer getStartMonth()
143    {
144        return this.startMonth;
145    }
146
147    /**
148     * Premier mois de l'année (inclus) à partir duquel la conversion s'applique.
149     * @param startMonthIn Integer
150     */
151    public void setStartMonth(Integer startMonthIn)
152    {
153        this.startMonth = startMonthIn;
154    }
155
156    private Integer endMonth;
157
158    /**
159     * Dernier mois de l'année (inclus) à partir duquel la conversion ne s'applique plus.
160     * @return this.endMonth Integer
161     */
162    public Integer getEndMonth()
163    {
164        return this.endMonth;
165    }
166
167    /**
168     * Dernier mois de l'année (inclus) à partir duquel la conversion ne s'applique plus.
169     * @param endMonthIn Integer
170     */
171    public void setEndMonth(Integer endMonthIn)
172    {
173        this.endMonth = endMonthIn;
174    }
175
176    private Integer year;
177
178    /**
179     * Année sur laquelle a été établie la relation taille-poids  (Optionnel). Si non renseigné,
180     * alors la relation est toujours valable ou bien  l'année est inconnue.
181     * @return this.year Integer
182     */
183    public Integer getYear()
184    {
185        return this.year;
186    }
187
188    /**
189     * Année sur laquelle a été établie la relation taille-poids  (Optionnel). Si non renseigné,
190     * alors la relation est toujours valable ou bien  l'année est inconnue.
191     * @param yearIn Integer
192     */
193    public void setYear(Integer yearIn)
194    {
195        this.year = yearIn;
196    }
197
198    private String description;
199
200    /**
201     * 
202     * @return this.description String
203     */
204    public String getDescription()
205    {
206        return this.description;
207    }
208
209    /**
210     * 
211     * @param descriptionIn String
212     */
213    public void setDescription(String descriptionIn)
214    {
215        this.description = descriptionIn;
216    }
217
218    private String comments;
219
220    /**
221     * 
222     * @return this.comments String
223     */
224    public String getComments()
225    {
226        return this.comments;
227    }
228
229    /**
230     * 
231     * @param commentsIn String
232     */
233    public void setComments(String commentsIn)
234    {
235        this.comments = commentsIn;
236    }
237
238    private Timestamp updateDate;
239
240    /**
241     * 
242     * @return this.updateDate Timestamp
243     */
244    public Timestamp getUpdateDate()
245    {
246        return this.updateDate;
247    }
248
249    /**
250     * 
251     * @param updateDateIn Timestamp
252     */
253    public void setUpdateDate(Timestamp updateDateIn)
254    {
255        this.updateDate = updateDateIn;
256    }
257
258    // Generate 7 associations
259    private OriginItemType originItemType;
260
261    /**
262     * The origin of the weight length conversion
263     * @since 3.5.0
264     * @return this.originItemType OriginItemType
265     */
266    public OriginItemType getOriginItemType()
267    {
268        return this.originItemType;
269    }
270
271    /**
272     * The origin of the weight length conversion
273     * @since 3.5.0
274     * @param originItemTypeIn OriginItemType
275     */
276    public void setOriginItemType(OriginItemType originItemTypeIn)
277    {
278        this.originItemType = originItemTypeIn;
279    }
280
281    private QualitativeValue sex;
282
283    /**
284     * Sexe de l'espèce scientifique pour lequel la relation taille/poids est valide.
285     * @return this.sex QualitativeValue
286     */
287    public QualitativeValue getSex()
288    {
289        return this.sex;
290    }
291
292    /**
293     * Sexe de l'espèce scientifique pour lequel la relation taille/poids est valide.
294     * @param sexIn QualitativeValue
295     */
296    public void setSex(QualitativeValue sexIn)
297    {
298        this.sex = sexIn;
299    }
300
301    private Parameter lengthParameter;
302
303    /**
304     * Un paramètre est une propriété du milieu ou d'un élément du milieu qui contribue à en
305     * apprécier les
306     * caractéristiques et/ou la qualité et/ou l'aptitude à des usages.
307     * Le paramètre se décline en trois types : quantitatif, qualitatif ou libre.
308     * Le type quantitatif se rapporte aux paramètres qui ont une infinité de résultats numériques.
309     * Le type qualitatif se rapporte aux paramètres qui ne prennent qu'un nombre limité de valeurs
310     * prédéfinies pour chacun d'eux.
311     * Le type libre, ou alphanumérique, correspond aux paramètres de valeurs alphanumériques, sans
312     * limite
313     * de valeurs possibles (hormis la longueur de la chaine : 40 max).
314     * Ces trois types sont mutuellement exclusifs.
315     * Exemple de paramètre :
316     * • Taille (numérique)
317     * • Age (numérique)
318     * • Sexe (qualitatif)
319     * • Catégorie commerciale (qualitatif)
320     * • Présentation commerciale (qualitatif)
321     * • Vrac / Hors Vrac (qualitatif)
322     * • Rejet / Débarquement (qualitatif) (Discard/Landing)
323     * • Stade de maturité (qualitatif) (Maturity stage)
324     * • Numéro de contrat (libre - alphanumérique)
325     * Cette liste n’est pas exhaustive.
326     * Nombre de lignes : 130
327     * @return this.lengthParameter Parameter
328     */
329    public Parameter getLengthParameter()
330    {
331        return this.lengthParameter;
332    }
333
334    /**
335     * Un paramètre est une propriété du milieu ou d'un élément du milieu qui contribue à en
336     * apprécier les
337     * caractéristiques et/ou la qualité et/ou l'aptitude à des usages.
338     * Le paramètre se décline en trois types : quantitatif, qualitatif ou libre.
339     * Le type quantitatif se rapporte aux paramètres qui ont une infinité de résultats numériques.
340     * Le type qualitatif se rapporte aux paramètres qui ne prennent qu'un nombre limité de valeurs
341     * prédéfinies pour chacun d'eux.
342     * Le type libre, ou alphanumérique, correspond aux paramètres de valeurs alphanumériques, sans
343     * limite
344     * de valeurs possibles (hormis la longueur de la chaine : 40 max).
345     * Ces trois types sont mutuellement exclusifs.
346     * Exemple de paramètre :
347     * • Taille (numérique)
348     * • Age (numérique)
349     * • Sexe (qualitatif)
350     * • Catégorie commerciale (qualitatif)
351     * • Présentation commerciale (qualitatif)
352     * • Vrac / Hors Vrac (qualitatif)
353     * • Rejet / Débarquement (qualitatif) (Discard/Landing)
354     * • Stade de maturité (qualitatif) (Maturity stage)
355     * • Numéro de contrat (libre - alphanumérique)
356     * Cette liste n’est pas exhaustive.
357     * Nombre de lignes : 130
358     * @param lengthParameterIn Parameter
359     */
360    public void setLengthParameter(Parameter lengthParameterIn)
361    {
362        this.lengthParameter = lengthParameterIn;
363    }
364
365    private Unit lengthUnit;
366
367    /**
368     * Unité d'une mesure.
369     * Nombre de lignes : 30
370     * @return this.lengthUnit Unit
371     */
372    public Unit getLengthUnit()
373    {
374        return this.lengthUnit;
375    }
376
377    /**
378     * Unité d'une mesure.
379     * Nombre de lignes : 30
380     * @param lengthUnitIn Unit
381     */
382    public void setLengthUnit(Unit lengthUnitIn)
383    {
384        this.lengthUnit = lengthUnitIn;
385    }
386
387    private ReferenceTaxon referenceTaxon;
388
389    /**
390     * Lien vers l'espèce scientifique
391     * @return this.referenceTaxon ReferenceTaxon
392     */
393    public ReferenceTaxon getReferenceTaxon()
394    {
395        return this.referenceTaxon;
396    }
397
398    /**
399     * Lien vers l'espèce scientifique
400     * @param referenceTaxonIn ReferenceTaxon
401     */
402    public void setReferenceTaxon(ReferenceTaxon referenceTaxonIn)
403    {
404        this.referenceTaxon = referenceTaxonIn;
405    }
406
407    private Location location;
408
409    /**
410     * Représente un lieu au sens général du terme. Il peut s'agir d'un lieu ponctuel, linéaire ou
411     * surfacique.
412     * Suivant sa classification et son niveau, il peut s'agir d'un secteur FAO, un port de pêche,
413     * un
414     * quartier maritime, une criée, etc.
415     * Nombre de lignes : lieux terrestre : 4500 + secteurs : 11210 + strates : 1000 + localités :
416     * 200
417     * @return this.location Location
418     */
419    public Location getLocation()
420    {
421        return this.location;
422    }
423
424    /**
425     * Représente un lieu au sens général du terme. Il peut s'agir d'un lieu ponctuel, linéaire ou
426     * surfacique.
427     * Suivant sa classification et son niveau, il peut s'agir d'un secteur FAO, un port de pêche,
428     * un
429     * quartier maritime, une criée, etc.
430     * Nombre de lignes : lieux terrestre : 4500 + secteurs : 11210 + strates : 1000 + localités :
431     * 200
432     * @param locationIn Location
433     */
434    public void setLocation(Location locationIn)
435    {
436        this.location = locationIn;
437    }
438
439    private Status status;
440
441    /**
442     * Pour les données du référentiel, information permettant de déterminer si une donnée est
443     * valide,
444     * obsolète ou temporaire.
445     * - obsolète (=inactif) : '0'
446     * - valide (=actif) : '1'
447     * - temporaire : '2'
448     * - en cours de suppression : '3'
449     * -  : '4'
450     * note : on a préfère ici 'valide' au terme 'actif' (utilisé dans Harmonie), pour ne pas
451     * confondre
452     * avec par exemple l'activité d'un navire sur un mois.
453     * @return this.status Status
454     */
455    public Status getStatus()
456    {
457        return this.status;
458    }
459
460    /**
461     * Pour les données du référentiel, information permettant de déterminer si une donnée est
462     * valide,
463     * obsolète ou temporaire.
464     * - obsolète (=inactif) : '0'
465     * - valide (=actif) : '1'
466     * - temporaire : '2'
467     * - en cours de suppression : '3'
468     * -  : '4'
469     * note : on a préfère ici 'valide' au terme 'actif' (utilisé dans Harmonie), pour ne pas
470     * confondre
471     * avec par exemple l'activité d'un navire sur un mois.
472     * @param statusIn Status
473     */
474    public void setStatus(Status statusIn)
475    {
476        this.status = statusIn;
477    }
478
479    /**
480     * Returns <code>true</code> if the argument is an WeightLengthConversion instance and all identifiers for this entity
481     * equal the identifiers of the argument entity. Returns <code>false</code> otherwise.
482     */
483    @Override
484    public boolean equals(Object object)
485    {
486        if (this == object)
487        {
488            return true;
489        }
490        if (!(object instanceof WeightLengthConversion))
491        {
492            return false;
493        }
494        final WeightLengthConversion that = (WeightLengthConversion)object;
495        if (this.id == null || that.getId() == null || !this.id.equals(that.getId()))
496        {
497            return false;
498        }
499        return true;
500    }
501
502    /**
503     * Returns a hash code based on this entity's identifiers.
504     */
505    @Override
506    public int hashCode()
507    {
508        int hashCode = 0;
509        hashCode = 29 * hashCode + (this.id == null ? 0 : this.id.hashCode());
510
511        return hashCode;
512    }
513
514    /**
515     * Constructs new instances of {@link WeightLengthConversion}.
516     */
517    public static final class Factory
518    {
519        /**
520         * Constructs a new instance of {@link WeightLengthConversion}.
521         * @return new WeightLengthConversionImpl()
522         */
523        public static WeightLengthConversion newInstance()
524        {
525            return new WeightLengthConversionImpl();
526        }
527
528        /**
529         * Constructs a new instance of {@link WeightLengthConversion}, taking all required and/or
530         * read-only properties as arguments, except for identifiers.
531         * @param conversionCoefficientA Double
532         * @param conversionCoefficientB Double
533         * @param startMonth Integer
534         * @param endMonth Integer
535         * @param updateDate Timestamp
536         * @param lengthParameter Parameter
537         * @param lengthUnit Unit
538         * @param referenceTaxon ReferenceTaxon
539         * @param location Location
540         * @param status Status
541         * @return newInstance
542         */
543        public static WeightLengthConversion newInstance(Double conversionCoefficientA, Double conversionCoefficientB, Integer startMonth, Integer endMonth, Timestamp updateDate, Parameter lengthParameter, Unit lengthUnit, ReferenceTaxon referenceTaxon, Location location, Status status)
544        {
545            final WeightLengthConversion entity = new WeightLengthConversionImpl();
546            entity.setConversionCoefficientA(conversionCoefficientA);
547            entity.setConversionCoefficientB(conversionCoefficientB);
548            entity.setStartMonth(startMonth);
549            entity.setEndMonth(endMonth);
550            entity.setUpdateDate(updateDate);
551            entity.setLengthParameter(lengthParameter);
552            entity.setLengthUnit(lengthUnit);
553            entity.setReferenceTaxon(referenceTaxon);
554            entity.setLocation(location);
555            entity.setStatus(status);
556            return entity;
557        }
558
559        /**
560         * Constructs a new instance of {@link WeightLengthConversion}, taking all possible properties
561         * (except the identifier(s))as arguments.
562         * @param conversionCoefficientA Double
563         * @param conversionCoefficientB Double
564         * @param startMonth Integer
565         * @param endMonth Integer
566         * @param year Integer
567         * @param description String
568         * @param comments String
569         * @param updateDate Timestamp
570         * @param originItemType OriginItemType
571         * @param sex QualitativeValue
572         * @param lengthParameter Parameter
573         * @param lengthUnit Unit
574         * @param referenceTaxon ReferenceTaxon
575         * @param location Location
576         * @param status Status
577         * @return newInstance WeightLengthConversion
578         */
579        public static WeightLengthConversion newInstance(Double conversionCoefficientA, Double conversionCoefficientB, Integer startMonth, Integer endMonth, Integer year, String description, String comments, Timestamp updateDate, OriginItemType originItemType, QualitativeValue sex, Parameter lengthParameter, Unit lengthUnit, ReferenceTaxon referenceTaxon, Location location, Status status)
580        {
581            final WeightLengthConversion entity = new WeightLengthConversionImpl();
582            entity.setConversionCoefficientA(conversionCoefficientA);
583            entity.setConversionCoefficientB(conversionCoefficientB);
584            entity.setStartMonth(startMonth);
585            entity.setEndMonth(endMonth);
586            entity.setYear(year);
587            entity.setDescription(description);
588            entity.setComments(comments);
589            entity.setUpdateDate(updateDate);
590            entity.setOriginItemType(originItemType);
591            entity.setSex(sex);
592            entity.setLengthParameter(lengthParameter);
593            entity.setLengthUnit(lengthUnit);
594            entity.setReferenceTaxon(referenceTaxon);
595            entity.setLocation(location);
596            entity.setStatus(status);
597            return entity;
598        }
599    }
600
601    /**
602     * @see Comparable#compareTo
603     */
604    public int compareTo(WeightLengthConversion o)
605    {
606        int cmp = 0;
607        if (this.getId() != null)
608        {
609            cmp = this.getId().compareTo(o.getId());
610        }
611        else
612        {
613            if (this.getConversionCoefficientA() != null)
614            {
615                cmp = (cmp != 0 ? cmp : this.getConversionCoefficientA().compareTo(o.getConversionCoefficientA()));
616            }
617            if (this.getConversionCoefficientB() != null)
618            {
619                cmp = (cmp != 0 ? cmp : this.getConversionCoefficientB().compareTo(o.getConversionCoefficientB()));
620            }
621            if (this.getStartMonth() != null)
622            {
623                cmp = (cmp != 0 ? cmp : this.getStartMonth().compareTo(o.getStartMonth()));
624            }
625            if (this.getEndMonth() != null)
626            {
627                cmp = (cmp != 0 ? cmp : this.getEndMonth().compareTo(o.getEndMonth()));
628            }
629            if (this.getYear() != null)
630            {
631                cmp = (cmp != 0 ? cmp : this.getYear().compareTo(o.getYear()));
632            }
633            if (this.getDescription() != null)
634            {
635                cmp = (cmp != 0 ? cmp : this.getDescription().compareTo(o.getDescription()));
636            }
637            if (this.getComments() != null)
638            {
639                cmp = (cmp != 0 ? cmp : this.getComments().compareTo(o.getComments()));
640            }
641            if (this.getUpdateDate() != null)
642            {
643                cmp = (cmp != 0 ? cmp : this.getUpdateDate().compareTo(o.getUpdateDate()));
644            }
645        }
646        return cmp;
647    }
648// HibernateEntity.vsl merge-point
649// WeightLengthConversion.java merge-point
650}