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