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.data.batch;
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.administration.user.Department;
032import fr.ifremer.adagio.core.dao.administration.user.Person;
033import java.io.Serializable;
034import java.sql.Timestamp;
035
036/**
037 * 
038 */
039// HibernateEntity.vsl annotations merge-point
040public abstract class BatchModel
041    implements Serializable, Comparable<BatchModel>
042{
043    /**
044     * The serial version UID of this class. Needed for serialization.
045     */
046    private static final long serialVersionUID = 6484476506548626860L;
047
048    // Generate 4 attributes
049    private Integer id;
050
051    /**
052     * Identifiant interne
053     * @return this.id Integer
054     */
055    public Integer getId()
056    {
057        return this.id;
058    }
059
060    /**
061     * Identifiant interne
062     * @param idIn Integer
063     */
064    public void setId(Integer idIn)
065    {
066        this.id = idIn;
067    }
068
069    private String name;
070
071    /**
072     * Le nom du modèle d'arbre d'échantillonnage.
073     * @return this.name String
074     */
075    public String getName()
076    {
077        return this.name;
078    }
079
080    /**
081     * Le nom du modèle d'arbre d'échantillonnage.
082     * @param nameIn String
083     */
084    public void setName(String nameIn)
085    {
086        this.name = nameIn;
087    }
088
089    private Boolean isGlobal = Boolean.valueOf(false);
090
091    /**
092     * Indique si le modèle est global (visible par les autres utilisateurs) ou local
093     * @return this.isGlobal Boolean
094     */
095    public Boolean isIsGlobal()
096    {
097        return this.isGlobal;
098    }
099
100    /**
101     * Indique si le modèle est global (visible par les autres utilisateurs) ou local
102     * @param isGlobalIn Boolean
103     */
104    public void setIsGlobal(Boolean isGlobalIn)
105    {
106        this.isGlobal = isGlobalIn;
107    }
108
109    private Timestamp updateDate;
110
111    /**
112     * 
113     * @return this.updateDate Timestamp
114     */
115    public Timestamp getUpdateDate()
116    {
117        return this.updateDate;
118    }
119
120    /**
121     * 
122     * @param updateDateIn Timestamp
123     */
124    public void setUpdateDate(Timestamp updateDateIn)
125    {
126        this.updateDate = updateDateIn;
127    }
128
129    // Generate 4 associations
130    private CatchBatch catchBatch;
131
132    /**
133     * Capture réalisée au cours d'une opération, et sur laquelle un échantillonnage est réalisé.
134     * La capture porte donc l'arbre d''échantillonnage.
135     * @return this.catchBatch CatchBatch
136     */
137    public CatchBatch getCatchBatch()
138    {
139        return this.catchBatch;
140    }
141
142    /**
143     * Capture réalisée au cours d'une opération, et sur laquelle un échantillonnage est réalisé.
144     * La capture porte donc l'arbre d''échantillonnage.
145     * @param catchBatchIn CatchBatch
146     */
147    public void setCatchBatch(CatchBatch catchBatchIn)
148    {
149        this.catchBatch = catchBatchIn;
150    }
151
152    private Person recorderPerson;
153
154    /**
155     * <html>
156     * <head>
157     * <style>
158     * p {padding:0px; margin:0px;}
159     * </style>
160     * </head>
161     * <body>
162     * <p>
163     * Personne liées aux données : utilisateur du système, ou observateurs,
164     * responsable de données, etc.
165     * </p>
166     * <p>
167     * </p>
168     * <p>
169     * Les personnes liées aux activités professionnelles de pêche sont plutôt
170     * gérer dans <i>VesselPerson</i>.
171     * </p>
172     * <p>
173     * </p>
174     * <p>
175     * Nombre de lignes : 100
176     * </p>
177     * </body>
178     * </html>
179     * @return this.recorderPerson Person
180     */
181    public Person getRecorderPerson()
182    {
183        return this.recorderPerson;
184    }
185
186    /**
187     * <html>
188     * <head>
189     * <style>
190     * p {padding:0px; margin:0px;}
191     * </style>
192     * </head>
193     * <body>
194     * <p>
195     * Personne liées aux données : utilisateur du système, ou observateurs,
196     * responsable de données, etc.
197     * </p>
198     * <p>
199     * </p>
200     * <p>
201     * Les personnes liées aux activités professionnelles de pêche sont plutôt
202     * gérer dans <i>VesselPerson</i>.
203     * </p>
204     * <p>
205     * </p>
206     * <p>
207     * Nombre de lignes : 100
208     * </p>
209     * </body>
210     * </html>
211     * @param recorderPersonIn Person
212     */
213    public void setRecorderPerson(Person recorderPersonIn)
214    {
215        this.recorderPerson = recorderPersonIn;
216    }
217
218    private Department recorderDepartment;
219
220    /**
221     * Service d'appartenance d'une personne.
222     * Il peut s'agir des départements et service de l'Ifremer, ou bien des entreprises, services
223     * extérieurs (sous-traitants, etc.).
224     * REMARQUE : nous en aurons besoin en v2, pour l'administration des personnes (rechercher une
225     * personne, gérer les sous-traitants, etc.), mais aussi pour identifier le service effectuant
226     * l’analyse d’un résultat de mesure.
227     * Nombre de lignes : 60
228     * @return this.recorderDepartment Department
229     */
230    public Department getRecorderDepartment()
231    {
232        return this.recorderDepartment;
233    }
234
235    /**
236     * Service d'appartenance d'une personne.
237     * Il peut s'agir des départements et service de l'Ifremer, ou bien des entreprises, services
238     * extérieurs (sous-traitants, etc.).
239     * REMARQUE : nous en aurons besoin en v2, pour l'administration des personnes (rechercher une
240     * personne, gérer les sous-traitants, etc.), mais aussi pour identifier le service effectuant
241     * l’analyse d’un résultat de mesure.
242     * Nombre de lignes : 60
243     * @param recorderDepartmentIn Department
244     */
245    public void setRecorderDepartment(Department recorderDepartmentIn)
246    {
247        this.recorderDepartment = recorderDepartmentIn;
248    }
249
250    /**
251     * Returns <code>true</code> if the argument is an BatchModel instance and all identifiers for this entity
252     * equal the identifiers of the argument entity. Returns <code>false</code> otherwise.
253     */
254    @Override
255    public boolean equals(Object object)
256    {
257        if (this == object)
258        {
259            return true;
260        }
261        if (!(object instanceof BatchModel))
262        {
263            return false;
264        }
265        final BatchModel that = (BatchModel)object;
266        if (this.id == null || that.getId() == null || !this.id.equals(that.getId()))
267        {
268            return false;
269        }
270        return true;
271    }
272
273    /**
274     * Returns a hash code based on this entity's identifiers.
275     */
276    @Override
277    public int hashCode()
278    {
279        int hashCode = 0;
280        hashCode = 29 * hashCode + (this.id == null ? 0 : this.id.hashCode());
281
282        return hashCode;
283    }
284
285    /**
286     * Constructs new instances of {@link BatchModel}.
287     */
288    public static final class Factory
289    {
290        /**
291         * Constructs a new instance of {@link BatchModel}.
292         * @return new BatchModelImpl()
293         */
294        public static BatchModel newInstance()
295        {
296            return new BatchModelImpl();
297        }
298
299        /**
300         * Constructs a new instance of {@link BatchModel}, taking all required and/or
301         * read-only properties as arguments, except for identifiers.
302         * @param name String
303         * @param isGlobal Boolean
304         * @param updateDate Timestamp
305         * @param catchBatch CatchBatch
306         * @param recorderDepartment Department
307         * @return newInstance
308         */
309        public static BatchModel newInstance(String name, Boolean isGlobal, Timestamp updateDate, CatchBatch catchBatch, Department recorderDepartment)
310        {
311            final BatchModel entity = new BatchModelImpl();
312            entity.setName(name);
313            entity.setIsGlobal(isGlobal);
314            entity.setUpdateDate(updateDate);
315            entity.setCatchBatch(catchBatch);
316            entity.setRecorderDepartment(recorderDepartment);
317            return entity;
318        }
319
320        /**
321         * Constructs a new instance of {@link BatchModel}, taking all possible properties
322         * (except the identifier(s))as arguments.
323         * @param name String
324         * @param isGlobal Boolean
325         * @param updateDate Timestamp
326         * @param catchBatch CatchBatch
327         * @param recorderPerson Person
328         * @param recorderDepartment Department
329         * @return newInstance BatchModel
330         */
331        public static BatchModel newInstance(String name, Boolean isGlobal, Timestamp updateDate, CatchBatch catchBatch, Person recorderPerson, Department recorderDepartment)
332        {
333            final BatchModel entity = new BatchModelImpl();
334            entity.setName(name);
335            entity.setIsGlobal(isGlobal);
336            entity.setUpdateDate(updateDate);
337            entity.setCatchBatch(catchBatch);
338            entity.setRecorderPerson(recorderPerson);
339            entity.setRecorderDepartment(recorderDepartment);
340            return entity;
341        }
342    }
343
344    /**
345     * @see Comparable#compareTo
346     */
347    public int compareTo(BatchModel o)
348    {
349        int cmp = 0;
350        if (this.getId() != null)
351        {
352            cmp = this.getId().compareTo(o.getId());
353        }
354        else
355        {
356            if (this.getName() != null)
357            {
358                cmp = (cmp != 0 ? cmp : this.getName().compareTo(o.getName()));
359            }
360            if (this.isIsGlobal() != null)
361            {
362                cmp = (cmp != 0 ? cmp : this.isIsGlobal().compareTo(o.isIsGlobal()));
363            }
364            if (this.getUpdateDate() != null)
365            {
366                cmp = (cmp != 0 ? cmp : this.getUpdateDate().compareTo(o.getUpdateDate()));
367            }
368        }
369        return cmp;
370    }
371// HibernateEntity.vsl merge-point
372// BatchModel.java merge-point
373}