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.qualification;
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.QualityFlag;
032import fr.ifremer.adagio.core.dao.referential.Status;
033import java.io.Serializable;
034import java.sql.Timestamp;
035
036/**
037 * Règle de qualification automatique
038 */
039// HibernateEntity.vsl annotations merge-point
040public abstract class QualificationRule
041    implements Serializable, Comparable<QualificationRule>
042{
043    /**
044     * The serial version UID of this class. Needed for serialization.
045     */
046    private static final long serialVersionUID = 162614108846766406L;
047
048    // Generate 7 attributes
049    private Integer id;
050
051    /**
052     * Idenfiant interne. Généré par le système.
053     * @return this.id Integer
054     */
055    public Integer getId()
056    {
057        return this.id;
058    }
059
060    /**
061     * Idenfiant interne. Généré par le système.
062     * @param idIn Integer
063     */
064    public void setId(Integer idIn)
065    {
066        this.id = idIn;
067    }
068
069    private String label;
070
071    /**
072     * Mnémonique de la règle
073     * @return this.label String
074     */
075    public String getLabel()
076    {
077        return this.label;
078    }
079
080    /**
081     * Mnémonique de la règle
082     * @param labelIn String
083     */
084    public void setLabel(String labelIn)
085    {
086        this.label = labelIn;
087    }
088
089    private String name;
090
091    /**
092     * 
093     * @return this.name String
094     */
095    public String getName()
096    {
097        return this.name;
098    }
099
100    /**
101     * 
102     * @param nameIn String
103     */
104    public void setName(String nameIn)
105    {
106        this.name = nameIn;
107    }
108
109    private String description;
110
111    /**
112     * 
113     * @return this.description String
114     */
115    public String getDescription()
116    {
117        return this.description;
118    }
119
120    /**
121     * 
122     * @param descriptionIn String
123     */
124    public void setDescription(String descriptionIn)
125    {
126        this.description = descriptionIn;
127    }
128
129    private String javaClass;
130
131    /**
132     * Classe Java utilisées pour executé la règle
133     * @return this.javaClass String
134     */
135    public String getJavaClass()
136    {
137        return this.javaClass;
138    }
139
140    /**
141     * Classe Java utilisées pour executé la règle
142     * @param javaClassIn String
143     */
144    public void setJavaClass(String javaClassIn)
145    {
146        this.javaClass = javaClassIn;
147    }
148
149    private String version;
150
151    /**
152     * 
153     * @return this.version String
154     */
155    public String getVersion()
156    {
157        return this.version;
158    }
159
160    /**
161     * 
162     * @param versionIn String
163     */
164    public void setVersion(String versionIn)
165    {
166        this.version = versionIn;
167    }
168
169    private Timestamp updateDate;
170
171    /**
172     * 
173     * @return this.updateDate Timestamp
174     */
175    public Timestamp getUpdateDate()
176    {
177        return this.updateDate;
178    }
179
180    /**
181     * 
182     * @param updateDateIn Timestamp
183     */
184    public void setUpdateDate(Timestamp updateDateIn)
185    {
186        this.updateDate = updateDateIn;
187    }
188
189    // Generate 3 associations
190    private QualityFlag defaultQualityFlag;
191
192    /**
193     * Indice qualité d'une donnée.
194     * Actuellement, les indices qualités identifiés sont :
195     * 0 - Non qualifiée,
196     * 1 - Bonne,
197     * 2 - Hors statistiques,
198     * 3 - Douteuse,
199     * 4 - Fausse,
200     * 5 - Corrigée,
201     * 8 - Incomplète,
202     * 9 - Absente.
203     * @return this.defaultQualityFlag QualityFlag
204     */
205    public QualityFlag getDefaultQualityFlag()
206    {
207        return this.defaultQualityFlag;
208    }
209
210    /**
211     * Indice qualité d'une donnée.
212     * Actuellement, les indices qualités identifiés sont :
213     * 0 - Non qualifiée,
214     * 1 - Bonne,
215     * 2 - Hors statistiques,
216     * 3 - Douteuse,
217     * 4 - Fausse,
218     * 5 - Corrigée,
219     * 8 - Incomplète,
220     * 9 - Absente.
221     * @param defaultQualityFlagIn QualityFlag
222     */
223    public void setDefaultQualityFlag(QualityFlag defaultQualityFlagIn)
224    {
225        this.defaultQualityFlag = defaultQualityFlagIn;
226    }
227
228    private Status status;
229
230    /**
231     * Pour les données du référentiel, information permettant de déterminer si une donnée est
232     * valide,
233     * obsolète ou temporaire.
234     * - obsolète (=inactif) : '0'
235     * - valide (=actif) : '1'
236     * - temporaire : '2'
237     * - en cours de suppression : '3'
238     * -  : '4'
239     * note : on a préfère ici 'valide' au terme 'actif' (utilisé dans Harmonie), pour ne pas
240     * confondre
241     * avec par exemple l'activité d'un navire sur un mois.
242     * @return this.status Status
243     */
244    public Status getStatus()
245    {
246        return this.status;
247    }
248
249    /**
250     * Pour les données du référentiel, information permettant de déterminer si une donnée est
251     * valide,
252     * obsolète ou temporaire.
253     * - obsolète (=inactif) : '0'
254     * - valide (=actif) : '1'
255     * - temporaire : '2'
256     * - en cours de suppression : '3'
257     * -  : '4'
258     * note : on a préfère ici 'valide' au terme 'actif' (utilisé dans Harmonie), pour ne pas
259     * confondre
260     * avec par exemple l'activité d'un navire sur un mois.
261     * @param statusIn Status
262     */
263    public void setStatus(Status statusIn)
264    {
265        this.status = statusIn;
266    }
267
268    /**
269     * Returns <code>true</code> if the argument is an QualificationRule instance and all identifiers for this entity
270     * equal the identifiers of the argument entity. Returns <code>false</code> otherwise.
271     */
272    @Override
273    public boolean equals(Object object)
274    {
275        if (this == object)
276        {
277            return true;
278        }
279        if (!(object instanceof QualificationRule))
280        {
281            return false;
282        }
283        final QualificationRule that = (QualificationRule)object;
284        if (this.id == null || that.getId() == null || !this.id.equals(that.getId()))
285        {
286            return false;
287        }
288        return true;
289    }
290
291    /**
292     * Returns a hash code based on this entity's identifiers.
293     */
294    @Override
295    public int hashCode()
296    {
297        int hashCode = 0;
298        hashCode = 29 * hashCode + (this.id == null ? 0 : this.id.hashCode());
299
300        return hashCode;
301    }
302
303    /**
304     * Constructs new instances of {@link QualificationRule}.
305     */
306    public static final class Factory
307    {
308        /**
309         * Constructs a new instance of {@link QualificationRule}.
310         * @return new QualificationRuleImpl()
311         */
312        public static QualificationRule newInstance()
313        {
314            return new QualificationRuleImpl();
315        }
316
317        /**
318         * Constructs a new instance of {@link QualificationRule}, taking all required and/or
319         * read-only properties as arguments, except for identifiers.
320         * @param label String
321         * @param name String
322         * @param javaClass String
323         * @param version String
324         * @param updateDate Timestamp
325         * @param defaultQualityFlag QualityFlag
326         * @param status Status
327         * @return newInstance
328         */
329        public static QualificationRule newInstance(String label, String name, String javaClass, String version, Timestamp updateDate, QualityFlag defaultQualityFlag, Status status)
330        {
331            final QualificationRule entity = new QualificationRuleImpl();
332            entity.setLabel(label);
333            entity.setName(name);
334            entity.setJavaClass(javaClass);
335            entity.setVersion(version);
336            entity.setUpdateDate(updateDate);
337            entity.setDefaultQualityFlag(defaultQualityFlag);
338            entity.setStatus(status);
339            return entity;
340        }
341
342        /**
343         * Constructs a new instance of {@link QualificationRule}, taking all possible properties
344         * (except the identifier(s))as arguments.
345         * @param label String
346         * @param name String
347         * @param description String
348         * @param javaClass String
349         * @param version String
350         * @param updateDate Timestamp
351         * @param defaultQualityFlag QualityFlag
352         * @param status Status
353         * @return newInstance QualificationRule
354         */
355        public static QualificationRule newInstance(String label, String name, String description, String javaClass, String version, Timestamp updateDate, QualityFlag defaultQualityFlag, Status status)
356        {
357            final QualificationRule entity = new QualificationRuleImpl();
358            entity.setLabel(label);
359            entity.setName(name);
360            entity.setDescription(description);
361            entity.setJavaClass(javaClass);
362            entity.setVersion(version);
363            entity.setUpdateDate(updateDate);
364            entity.setDefaultQualityFlag(defaultQualityFlag);
365            entity.setStatus(status);
366            return entity;
367        }
368    }
369
370    /**
371     * @see Comparable#compareTo
372     */
373    public int compareTo(QualificationRule o)
374    {
375        int cmp = 0;
376        if (this.getId() != null)
377        {
378            cmp = this.getId().compareTo(o.getId());
379        }
380        else
381        {
382            if (this.getLabel() != null)
383            {
384                cmp = (cmp != 0 ? cmp : this.getLabel().compareTo(o.getLabel()));
385            }
386            if (this.getName() != null)
387            {
388                cmp = (cmp != 0 ? cmp : this.getName().compareTo(o.getName()));
389            }
390            if (this.getDescription() != null)
391            {
392                cmp = (cmp != 0 ? cmp : this.getDescription().compareTo(o.getDescription()));
393            }
394            if (this.getJavaClass() != null)
395            {
396                cmp = (cmp != 0 ? cmp : this.getJavaClass().compareTo(o.getJavaClass()));
397            }
398            if (this.getVersion() != null)
399            {
400                cmp = (cmp != 0 ? cmp : this.getVersion().compareTo(o.getVersion()));
401            }
402            if (this.getUpdateDate() != null)
403            {
404                cmp = (cmp != 0 ? cmp : this.getUpdateDate().compareTo(o.getUpdateDate()));
405            }
406        }
407        return cmp;
408    }
409// HibernateEntity.vsl merge-point
410// QualificationRule.java merge-point
411}