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;
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 java.io.Serializable;
032import java.sql.Timestamp;
033
034/**
035 * Précision de la mesure par rapport au seuil de détection de l'instrument d'analyse. Se
036 * trouve-t-on au dessus ou en dessous du seuil de détection ?
037 * Utilisée principalement lors de l'utilisation d'instrument de mesure.
038 * La liste sera la suivante :
039 * - supérieure valeur maximale pouvant être détectée
040 * - inférieure à la valeur minimale pouvant être détectée
041 */
042// HibernateEntity.vsl annotations merge-point
043public abstract class NumericalPrecision
044    implements Serializable, Comparable<NumericalPrecision>
045{
046    /**
047     * The serial version UID of this class. Needed for serialization.
048     */
049    private static final long serialVersionUID = -2526199290188886335L;
050
051    // Generate 5 attributes
052    private Integer id;
053
054    /**
055     * Idenfiant interne. Généré par le système.
056     * @return this.id Integer
057     */
058    public Integer getId()
059    {
060        return this.id;
061    }
062
063    /**
064     * Idenfiant interne. Généré par le système.
065     * @param idIn Integer
066     */
067    public void setId(Integer idIn)
068    {
069        this.id = idIn;
070    }
071
072    private String name;
073
074    /**
075     * 
076     * @return this.name String
077     */
078    public String getName()
079    {
080        return this.name;
081    }
082
083    /**
084     * 
085     * @param nameIn String
086     */
087    public void setName(String nameIn)
088    {
089        this.name = nameIn;
090    }
091
092    private String description;
093
094    /**
095     * 
096     * @return this.description String
097     */
098    public String getDescription()
099    {
100        return this.description;
101    }
102
103    /**
104     * 
105     * @param descriptionIn String
106     */
107    public void setDescription(String descriptionIn)
108    {
109        this.description = descriptionIn;
110    }
111
112    private Timestamp updateDate;
113
114    /**
115     * 
116     * @return this.updateDate Timestamp
117     */
118    public Timestamp getUpdateDate()
119    {
120        return this.updateDate;
121    }
122
123    /**
124     * 
125     * @param updateDateIn Timestamp
126     */
127    public void setUpdateDate(Timestamp updateDateIn)
128    {
129        this.updateDate = updateDateIn;
130    }
131
132    private String comments;
133
134    /**
135     * 
136     * @return this.comments String
137     */
138    public String getComments()
139    {
140        return this.comments;
141    }
142
143    /**
144     * 
145     * @param commentsIn String
146     */
147    public void setComments(String commentsIn)
148    {
149        this.comments = commentsIn;
150    }
151
152    // Generate 2 associations
153    private Status status;
154
155    /**
156     * Pour les données du référentiel, information permettant de déterminer si une donnée est
157     * valide,
158     * obsolète ou temporaire.
159     * - obsolète (=inactif) : '0'
160     * - valide (=actif) : '1'
161     * - temporaire : '2'
162     * - en cours de suppression : '3'
163     * -  : '4'
164     * note : on a préfère ici 'valide' au terme 'actif' (utilisé dans Harmonie), pour ne pas
165     * confondre
166     * avec par exemple l'activité d'un navire sur un mois.
167     * @return this.status Status
168     */
169    public Status getStatus()
170    {
171        return this.status;
172    }
173
174    /**
175     * Pour les données du référentiel, information permettant de déterminer si une donnée est
176     * valide,
177     * obsolète ou temporaire.
178     * - obsolète (=inactif) : '0'
179     * - valide (=actif) : '1'
180     * - temporaire : '2'
181     * - en cours de suppression : '3'
182     * -  : '4'
183     * note : on a préfère ici 'valide' au terme 'actif' (utilisé dans Harmonie), pour ne pas
184     * confondre
185     * avec par exemple l'activité d'un navire sur un mois.
186     * @param statusIn Status
187     */
188    public void setStatus(Status statusIn)
189    {
190        this.status = statusIn;
191    }
192
193    /**
194     * Returns <code>true</code> if the argument is an NumericalPrecision instance and all identifiers for this entity
195     * equal the identifiers of the argument entity. Returns <code>false</code> otherwise.
196     */
197    @Override
198    public boolean equals(Object object)
199    {
200        if (this == object)
201        {
202            return true;
203        }
204        if (!(object instanceof NumericalPrecision))
205        {
206            return false;
207        }
208        final NumericalPrecision that = (NumericalPrecision)object;
209        if (this.id == null || that.getId() == null || !this.id.equals(that.getId()))
210        {
211            return false;
212        }
213        return true;
214    }
215
216    /**
217     * Returns a hash code based on this entity's identifiers.
218     */
219    @Override
220    public int hashCode()
221    {
222        int hashCode = 0;
223        hashCode = 29 * hashCode + (this.id == null ? 0 : this.id.hashCode());
224
225        return hashCode;
226    }
227
228    /**
229     * Constructs new instances of {@link NumericalPrecision}.
230     */
231    public static final class Factory
232    {
233        /**
234         * Constructs a new instance of {@link NumericalPrecision}.
235         * @return new NumericalPrecisionImpl()
236         */
237        public static NumericalPrecision newInstance()
238        {
239            return new NumericalPrecisionImpl();
240        }
241
242        /**
243         * Constructs a new instance of {@link NumericalPrecision}, taking all required and/or
244         * read-only properties as arguments, except for identifiers.
245         * @param name String
246         * @param description String
247         * @param updateDate Timestamp
248         * @param status Status
249         * @return newInstance
250         */
251        public static NumericalPrecision newInstance(String name, String description, Timestamp updateDate, Status status)
252        {
253            final NumericalPrecision entity = new NumericalPrecisionImpl();
254            entity.setName(name);
255            entity.setDescription(description);
256            entity.setUpdateDate(updateDate);
257            entity.setStatus(status);
258            return entity;
259        }
260
261        /**
262         * Constructs a new instance of {@link NumericalPrecision}, taking all possible properties
263         * (except the identifier(s))as arguments.
264         * @param name String
265         * @param description String
266         * @param updateDate Timestamp
267         * @param comments String
268         * @param status Status
269         * @return newInstance NumericalPrecision
270         */
271        public static NumericalPrecision newInstance(String name, String description, Timestamp updateDate, String comments, Status status)
272        {
273            final NumericalPrecision entity = new NumericalPrecisionImpl();
274            entity.setName(name);
275            entity.setDescription(description);
276            entity.setUpdateDate(updateDate);
277            entity.setComments(comments);
278            entity.setStatus(status);
279            return entity;
280        }
281    }
282
283    /**
284     * @see Comparable#compareTo
285     */
286    public int compareTo(NumericalPrecision o)
287    {
288        int cmp = 0;
289        if (this.getId() != null)
290        {
291            cmp = this.getId().compareTo(o.getId());
292        }
293        else
294        {
295            if (this.getName() != null)
296            {
297                cmp = (cmp != 0 ? cmp : this.getName().compareTo(o.getName()));
298            }
299            if (this.getDescription() != null)
300            {
301                cmp = (cmp != 0 ? cmp : this.getDescription().compareTo(o.getDescription()));
302            }
303            if (this.getUpdateDate() != null)
304            {
305                cmp = (cmp != 0 ? cmp : this.getUpdateDate().compareTo(o.getUpdateDate()));
306            }
307            if (this.getComments() != null)
308            {
309                cmp = (cmp != 0 ? cmp : this.getComments().compareTo(o.getComments()));
310            }
311        }
312        return cmp;
313    }
314// HibernateEntity.vsl merge-point
315// NumericalPrecision.java merge-point
316}