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.location.Location;
033import fr.ifremer.adagio.core.dao.referential.pmfm.QualitativeValue;
034import fr.ifremer.adagio.core.dao.referential.taxon.TaxonGroup;
035import java.io.Serializable;
036import java.sql.Timestamp;
037import java.util.Date;
038
039/**
040 * <html>
041 * <head>
042 * </head>
043 * <body>
044 * <p>
045 * <b>Equivalent poids vif </b>:<br><br>
046 * </p>
047 * <p>
048 * Le calcul se fait par multiplication du poids total du lot par un
049 * coefficient multiplicateur (convCoeff) . Ce coefficient est obtenu &#224;
050 * partir des caract&#233;ristiques suivantes :<br>- esp&#232;ce commerciale :
051 * TaxonGroup<br>- pr&#233;sentation du poisson: fishPresentation (ex :
052 * &quot;Entier&quot;, &quot;Vid&#233;&quot;, &quot;&#201;t&#234;t&#233;, vid&#233;,
053 * &#233;queut&#233;&quot;, &quot;D&#233;cortiqu&#233;&quot;, ...).<br>-
054 * Etat du poisson : fishState (ex : &quot;frais&quot;, &quot;congel&#233;&quot;,
055 * &quot;sal&#233;&quot;,
056 * &quot;s&#233;ch&#233;&quot;...).<br>- Pays dans lequel s&#8217;est effectu&#233;e
057 * la capture.
058 * </p>
059 * <p>
060 * <u>Definition FAO :</u> &quot;Round Weigth&quot; : the weight of the whole fish
061 * before processing or removal of any part.<br>FAO (1998): Guidelines for
062 * the routine collection of capture fishery data. FAO Fish. Tech. Pap,
063 * 382: 113 p.
064 * </p>
065 * </body>
066 * </html>
067 */
068// HibernateEntity.vsl annotations merge-point
069public abstract class RoundWeightConversion
070    implements Serializable, Comparable<RoundWeightConversion>
071{
072    /**
073     * The serial version UID of this class. Needed for serialization.
074     */
075    private static final long serialVersionUID = 1891434524212437230L;
076
077    // Generate 7 attributes
078    private Integer id;
079
080    /**
081     * Idenfiant interne. Généré par le système.
082     * @return this.id Integer
083     */
084    public Integer getId()
085    {
086        return this.id;
087    }
088
089    /**
090     * Idenfiant interne. Généré par le système.
091     * @param idIn Integer
092     */
093    public void setId(Integer idIn)
094    {
095        this.id = idIn;
096    }
097
098    private Float conversionCoefficient;
099
100    /**
101     * Coefficient de conversion pour l'équivalent poids vif.
102     * @return this.conversionCoefficient Float
103     */
104    public Float getConversionCoefficient()
105    {
106        return this.conversionCoefficient;
107    }
108
109    /**
110     * Coefficient de conversion pour l'équivalent poids vif.
111     * @param conversionCoefficientIn Float
112     */
113    public void setConversionCoefficient(Float conversionCoefficientIn)
114    {
115        this.conversionCoefficient = conversionCoefficientIn;
116    }
117
118    private Date startDate;
119
120    /**
121     * Date de début de validité de l'équivalent poids vif
122     * @return this.startDate Date
123     */
124    public Date getStartDate()
125    {
126        return this.startDate;
127    }
128
129    /**
130     * Date de début de validité de l'équivalent poids vif
131     * @param startDateIn Date
132     */
133    public void setStartDate(Date startDateIn)
134    {
135        this.startDate = startDateIn;
136    }
137
138    private Date endDate;
139
140    /**
141     * Date de fin de validité de l'équivalent poids vif.
142     * Si vide : toujours actif.
143     * @return this.endDate Date
144     */
145    public Date getEndDate()
146    {
147        return this.endDate;
148    }
149
150    /**
151     * Date de fin de validité de l'équivalent poids vif.
152     * Si vide : toujours actif.
153     * @param endDateIn Date
154     */
155    public void setEndDate(Date endDateIn)
156    {
157        this.endDate = endDateIn;
158    }
159
160    private String description;
161
162    /**
163     * 
164     * @return this.description String
165     */
166    public String getDescription()
167    {
168        return this.description;
169    }
170
171    /**
172     * 
173     * @param descriptionIn String
174     */
175    public void setDescription(String descriptionIn)
176    {
177        this.description = descriptionIn;
178    }
179
180    private String comments;
181
182    /**
183     * 
184     * @return this.comments String
185     */
186    public String getComments()
187    {
188        return this.comments;
189    }
190
191    /**
192     * 
193     * @param commentsIn String
194     */
195    public void setComments(String commentsIn)
196    {
197        this.comments = commentsIn;
198    }
199
200    private Timestamp updateDate;
201
202    /**
203     * 
204     * @return this.updateDate Timestamp
205     */
206    public Timestamp getUpdateDate()
207    {
208        return this.updateDate;
209    }
210
211    /**
212     * 
213     * @param updateDateIn Timestamp
214     */
215    public void setUpdateDate(Timestamp updateDateIn)
216    {
217        this.updateDate = updateDateIn;
218    }
219
220    // Generate 5 associations
221    private OriginItemType originItemType;
222
223    /**
224     * The origin of the round weight conversion
225     * @since 3.5.0
226     * @return this.originItemType OriginItemType
227     */
228    public OriginItemType getOriginItemType()
229    {
230        return this.originItemType;
231    }
232
233    /**
234     * The origin of the round weight conversion
235     * @since 3.5.0
236     * @param originItemTypeIn OriginItemType
237     */
238    public void setOriginItemType(OriginItemType originItemTypeIn)
239    {
240        this.originItemType = originItemTypeIn;
241    }
242
243    private QualitativeValue preserving;
244
245    /**
246     * Etat du poisson (entier, Eteté, etc.)
247     * @return this.preserving QualitativeValue
248     */
249    public QualitativeValue getPreserving()
250    {
251        return this.preserving;
252    }
253
254    /**
255     * Etat du poisson (entier, Eteté, etc.)
256     * @param preservingIn QualitativeValue
257     */
258    public void setPreserving(QualitativeValue preservingIn)
259    {
260        this.preserving = preservingIn;
261    }
262
263    private QualitativeValue dressing;
264
265    /**
266     * Présentation du poisson (Frais, Congelé, ...)
267     * @return this.dressing QualitativeValue
268     */
269    public QualitativeValue getDressing()
270    {
271        return this.dressing;
272    }
273
274    /**
275     * Présentation du poisson (Frais, Congelé, ...)
276     * @param dressingIn QualitativeValue
277     */
278    public void setDressing(QualitativeValue dressingIn)
279    {
280        this.dressing = dressingIn;
281    }
282
283    private TaxonGroup taxonGroup;
284
285    /**
286     * Lien vers l'espèce commerciale
287     * @return this.taxonGroup TaxonGroup
288     */
289    public TaxonGroup getTaxonGroup()
290    {
291        return this.taxonGroup;
292    }
293
294    /**
295     * Lien vers l'espèce commerciale
296     * @param taxonGroupIn TaxonGroup
297     */
298    public void setTaxonGroup(TaxonGroup taxonGroupIn)
299    {
300        this.taxonGroup = taxonGroupIn;
301    }
302
303    private Location location;
304
305    /**
306     * Représente un lieu au sens général du terme. Il peut s'agir d'un lieu ponctuel, linéaire ou
307     * surfacique.
308     * Suivant sa classification et son niveau, il peut s'agir d'un secteur FAO, un port de pêche,
309     * un
310     * quartier maritime, une criée, etc.
311     * Nombre de lignes : lieux terrestre : 4500 + secteurs : 11210 + strates : 1000 + localités :
312     * 200
313     * @return this.location Location
314     */
315    public Location getLocation()
316    {
317        return this.location;
318    }
319
320    /**
321     * Représente un lieu au sens général du terme. Il peut s'agir d'un lieu ponctuel, linéaire ou
322     * surfacique.
323     * Suivant sa classification et son niveau, il peut s'agir d'un secteur FAO, un port de pêche,
324     * un
325     * quartier maritime, une criée, etc.
326     * Nombre de lignes : lieux terrestre : 4500 + secteurs : 11210 + strates : 1000 + localités :
327     * 200
328     * @param locationIn Location
329     */
330    public void setLocation(Location locationIn)
331    {
332        this.location = locationIn;
333    }
334
335    /**
336     * Returns <code>true</code> if the argument is an RoundWeightConversion instance and all identifiers for this entity
337     * equal the identifiers of the argument entity. Returns <code>false</code> otherwise.
338     */
339    @Override
340    public boolean equals(Object object)
341    {
342        if (this == object)
343        {
344            return true;
345        }
346        if (!(object instanceof RoundWeightConversion))
347        {
348            return false;
349        }
350        final RoundWeightConversion that = (RoundWeightConversion)object;
351        if (this.id == null || that.getId() == null || !this.id.equals(that.getId()))
352        {
353            return false;
354        }
355        return true;
356    }
357
358    /**
359     * Returns a hash code based on this entity's identifiers.
360     */
361    @Override
362    public int hashCode()
363    {
364        int hashCode = 0;
365        hashCode = 29 * hashCode + (this.id == null ? 0 : this.id.hashCode());
366
367        return hashCode;
368    }
369
370    /**
371     * Constructs new instances of {@link RoundWeightConversion}.
372     */
373    public static final class Factory
374    {
375        /**
376         * Constructs a new instance of {@link RoundWeightConversion}.
377         * @return new RoundWeightConversionImpl()
378         */
379        public static RoundWeightConversion newInstance()
380        {
381            return new RoundWeightConversionImpl();
382        }
383
384        /**
385         * Constructs a new instance of {@link RoundWeightConversion}, taking all required and/or
386         * read-only properties as arguments, except for identifiers.
387         * @param conversionCoefficient Float
388         * @param startDate Date
389         * @param updateDate Timestamp
390         * @param preserving QualitativeValue
391         * @param dressing QualitativeValue
392         * @param taxonGroup TaxonGroup
393         * @param location Location
394         * @return newInstance
395         */
396        public static RoundWeightConversion newInstance(Float conversionCoefficient, Date startDate, Timestamp updateDate, QualitativeValue preserving, QualitativeValue dressing, TaxonGroup taxonGroup, Location location)
397        {
398            final RoundWeightConversion entity = new RoundWeightConversionImpl();
399            entity.setConversionCoefficient(conversionCoefficient);
400            entity.setStartDate(startDate);
401            entity.setUpdateDate(updateDate);
402            entity.setPreserving(preserving);
403            entity.setDressing(dressing);
404            entity.setTaxonGroup(taxonGroup);
405            entity.setLocation(location);
406            return entity;
407        }
408
409        /**
410         * Constructs a new instance of {@link RoundWeightConversion}, taking all possible properties
411         * (except the identifier(s))as arguments.
412         * @param conversionCoefficient Float
413         * @param startDate Date
414         * @param endDate Date
415         * @param description String
416         * @param comments String
417         * @param updateDate Timestamp
418         * @param originItemType OriginItemType
419         * @param preserving QualitativeValue
420         * @param dressing QualitativeValue
421         * @param taxonGroup TaxonGroup
422         * @param location Location
423         * @return newInstance RoundWeightConversion
424         */
425        public static RoundWeightConversion newInstance(Float conversionCoefficient, Date startDate, Date endDate, String description, String comments, Timestamp updateDate, OriginItemType originItemType, QualitativeValue preserving, QualitativeValue dressing, TaxonGroup taxonGroup, Location location)
426        {
427            final RoundWeightConversion entity = new RoundWeightConversionImpl();
428            entity.setConversionCoefficient(conversionCoefficient);
429            entity.setStartDate(startDate);
430            entity.setEndDate(endDate);
431            entity.setDescription(description);
432            entity.setComments(comments);
433            entity.setUpdateDate(updateDate);
434            entity.setOriginItemType(originItemType);
435            entity.setPreserving(preserving);
436            entity.setDressing(dressing);
437            entity.setTaxonGroup(taxonGroup);
438            entity.setLocation(location);
439            return entity;
440        }
441    }
442
443    /**
444     * @see Comparable#compareTo
445     */
446    public int compareTo(RoundWeightConversion o)
447    {
448        int cmp = 0;
449        if (this.getId() != null)
450        {
451            cmp = this.getId().compareTo(o.getId());
452        }
453        else
454        {
455            if (this.getConversionCoefficient() != null)
456            {
457                cmp = (cmp != 0 ? cmp : this.getConversionCoefficient().compareTo(o.getConversionCoefficient()));
458            }
459            if (this.getStartDate() != null)
460            {
461                cmp = (cmp != 0 ? cmp : this.getStartDate().compareTo(o.getStartDate()));
462            }
463            if (this.getEndDate() != null)
464            {
465                cmp = (cmp != 0 ? cmp : this.getEndDate().compareTo(o.getEndDate()));
466            }
467            if (this.getDescription() != null)
468            {
469                cmp = (cmp != 0 ? cmp : this.getDescription().compareTo(o.getDescription()));
470            }
471            if (this.getComments() != null)
472            {
473                cmp = (cmp != 0 ? cmp : this.getComments().compareTo(o.getComments()));
474            }
475            if (this.getUpdateDate() != null)
476            {
477                cmp = (cmp != 0 ? cmp : this.getUpdateDate().compareTo(o.getUpdateDate()));
478            }
479        }
480        return cmp;
481    }
482// HibernateEntity.vsl merge-point
483// RoundWeightConversion.java merge-point
484}