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.administration.programStrategy;
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.location.Location;
032import java.io.Serializable;
033import java.util.Collection;
034import java.util.HashSet;
035
036/**
037 * Une stratégie applicable est la stratégie qui s'applique pour un lieu de surveillance donné
038 * durant un interval de dates défini.
039 */
040// HibernateEntity.vsl annotations merge-point
041public abstract class AppliedStrategy
042    implements Serializable, Comparable<AppliedStrategy>
043{
044    /**
045     * The serial version UID of this class. Needed for serialization.
046     */
047    private static final long serialVersionUID = 5822927428345985698L;
048
049    // Generate 1 attributes
050    private Integer id;
051
052    /**
053     * Identifiant 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     * Identifiant 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    // Generate 5 associations
071    private Collection<BatchModelAppliedStrategy> batchModelAppliedStrategies = new HashSet<BatchModelAppliedStrategy>();
072
073    /**
074     * 
075     * @return this.batchModelAppliedStrategies Collection<BatchModelAppliedStrategy>
076     */
077    public Collection<BatchModelAppliedStrategy> getBatchModelAppliedStrategies()
078    {
079        return this.batchModelAppliedStrategies;
080    }
081
082    /**
083     * 
084     * @param batchModelAppliedStrategiesIn Collection<BatchModelAppliedStrategy>
085     */
086    public void setBatchModelAppliedStrategies(Collection<BatchModelAppliedStrategy> batchModelAppliedStrategiesIn)
087    {
088        this.batchModelAppliedStrategies = batchModelAppliedStrategiesIn;
089    }
090
091    /**
092     * 
093     * @param elementToAdd BatchModelAppliedStrategy
094     * @return <tt>true</tt> if this collection changed as a result of the
095     *         call
096     */
097    public boolean addBatchModelAppliedStrategies(BatchModelAppliedStrategy elementToAdd)
098    {
099        return this.batchModelAppliedStrategies.add(elementToAdd);
100    }
101
102    /**
103     * 
104     * @param elementToRemove BatchModelAppliedStrategy
105     * @return <tt>true</tt> if this collection changed as a result of the
106     *         call
107     */
108    public boolean removeBatchModelAppliedStrategies(BatchModelAppliedStrategy elementToRemove)
109    {
110        return this.batchModelAppliedStrategies.remove(elementToRemove);
111    }
112
113    private Collection<AppliedPeriod> appliedPeriods = new HashSet<AppliedPeriod>();
114
115    /**
116     * Interval de dates d'une stratégie applicable.
117     * @return this.appliedPeriods Collection<AppliedPeriod>
118     */
119    public Collection<AppliedPeriod> getAppliedPeriods()
120    {
121        return this.appliedPeriods;
122    }
123
124    /**
125     * Interval de dates d'une stratégie applicable.
126     * @param appliedPeriodsIn Collection<AppliedPeriod>
127     */
128    public void setAppliedPeriods(Collection<AppliedPeriod> appliedPeriodsIn)
129    {
130        this.appliedPeriods = appliedPeriodsIn;
131    }
132
133    /**
134     * Interval de dates d'une stratégie applicable.
135     * @param elementToAdd AppliedPeriod
136     * @return <tt>true</tt> if this collection changed as a result of the
137     *         call
138     */
139    public boolean addAppliedPeriods(AppliedPeriod elementToAdd)
140    {
141        return this.appliedPeriods.add(elementToAdd);
142    }
143
144    /**
145     * Interval de dates d'une stratégie applicable.
146     * @param elementToRemove AppliedPeriod
147     * @return <tt>true</tt> if this collection changed as a result of the
148     *         call
149     */
150    public boolean removeAppliedPeriods(AppliedPeriod elementToRemove)
151    {
152        return this.appliedPeriods.remove(elementToRemove);
153    }
154
155    private Strategy strategy;
156
157    /**
158     * La stratégie définit a priori ce que devront être les données présentes dans le système de
159     * l'origine
160     * de la collecte des données. Il s'agit de la liste des paramètres à mesurer, ainsi que des
161     * méthodes
162     * préconisées pour chacun de ces paramètres. La stratégie permet ainsi d'aider à la saisie des
163     * données, en personnalisant les écrans, et facilite la consultation rapide du contenu
164     * théorique de la
165     * base.
166     * Par exemple, on pourra avoir les stratégies suivantes :
167     * - stratégie "échantillonnage pendant les marées observées"
168     * - stratégie "échantillonnage pendant les campagne à la mer"
169     * @return this.strategy Strategy
170     */
171    public Strategy getStrategy()
172    {
173        return this.strategy;
174    }
175
176    /**
177     * La stratégie définit a priori ce que devront être les données présentes dans le système de
178     * l'origine
179     * de la collecte des données. Il s'agit de la liste des paramètres à mesurer, ainsi que des
180     * méthodes
181     * préconisées pour chacun de ces paramètres. La stratégie permet ainsi d'aider à la saisie des
182     * données, en personnalisant les écrans, et facilite la consultation rapide du contenu
183     * théorique de la
184     * base.
185     * Par exemple, on pourra avoir les stratégies suivantes :
186     * - stratégie "échantillonnage pendant les marées observées"
187     * - stratégie "échantillonnage pendant les campagne à la mer"
188     * @param strategyIn Strategy
189     */
190    public void setStrategy(Strategy strategyIn)
191    {
192        this.strategy = strategyIn;
193    }
194
195    private Location location;
196
197    /**
198     * Représente un lieu au sens général du terme. Il peut s'agir d'un lieu ponctuel, linéaire ou
199     * surfacique.
200     * Suivant sa classification et son niveau, il peut s'agir d'un secteur FAO, un port de pêche,
201     * un
202     * quartier maritime, une criée, etc.
203     * Nombre de lignes : lieux terrestre : 4500 + secteurs : 11210 + strates : 1000 + localités :
204     * 200
205     * @return this.location Location
206     */
207    public Location getLocation()
208    {
209        return this.location;
210    }
211
212    /**
213     * Représente un lieu au sens général du terme. Il peut s'agir d'un lieu ponctuel, linéaire ou
214     * surfacique.
215     * Suivant sa classification et son niveau, il peut s'agir d'un secteur FAO, un port de pêche,
216     * un
217     * quartier maritime, une criée, etc.
218     * Nombre de lignes : lieux terrestre : 4500 + secteurs : 11210 + strates : 1000 + localités :
219     * 200
220     * @param locationIn Location
221     */
222    public void setLocation(Location locationIn)
223    {
224        this.location = locationIn;
225    }
226
227    private Collection<PmfmAppliedStrategy> pmfmAppliedStrategies = new HashSet<PmfmAppliedStrategy>();
228
229    /**
230     * 
231     * @return this.pmfmAppliedStrategies Collection<PmfmAppliedStrategy>
232     */
233    public Collection<PmfmAppliedStrategy> getPmfmAppliedStrategies()
234    {
235        return this.pmfmAppliedStrategies;
236    }
237
238    /**
239     * 
240     * @param pmfmAppliedStrategiesIn Collection<PmfmAppliedStrategy>
241     */
242    public void setPmfmAppliedStrategies(Collection<PmfmAppliedStrategy> pmfmAppliedStrategiesIn)
243    {
244        this.pmfmAppliedStrategies = pmfmAppliedStrategiesIn;
245    }
246
247    /**
248     * 
249     * @param elementToAdd PmfmAppliedStrategy
250     * @return <tt>true</tt> if this collection changed as a result of the
251     *         call
252     */
253    public boolean addPmfmAppliedStrategies(PmfmAppliedStrategy elementToAdd)
254    {
255        return this.pmfmAppliedStrategies.add(elementToAdd);
256    }
257
258    /**
259     * 
260     * @param elementToRemove PmfmAppliedStrategy
261     * @return <tt>true</tt> if this collection changed as a result of the
262     *         call
263     */
264    public boolean removePmfmAppliedStrategies(PmfmAppliedStrategy elementToRemove)
265    {
266        return this.pmfmAppliedStrategies.remove(elementToRemove);
267    }
268
269    /**
270     * Returns <code>true</code> if the argument is an AppliedStrategy instance and all identifiers for this entity
271     * equal the identifiers of the argument entity. Returns <code>false</code> otherwise.
272     */
273    @Override
274    public boolean equals(Object object)
275    {
276        if (this == object)
277        {
278            return true;
279        }
280        if (!(object instanceof AppliedStrategy))
281        {
282            return false;
283        }
284        final AppliedStrategy that = (AppliedStrategy)object;
285        if (this.id == null || that.getId() == null || !this.id.equals(that.getId()))
286        {
287            return false;
288        }
289        return true;
290    }
291
292    /**
293     * Returns a hash code based on this entity's identifiers.
294     */
295    @Override
296    public int hashCode()
297    {
298        int hashCode = 0;
299        hashCode = 29 * hashCode + (this.id == null ? 0 : this.id.hashCode());
300
301        return hashCode;
302    }
303
304    /**
305     * Constructs new instances of {@link AppliedStrategy}.
306     */
307    public static final class Factory
308    {
309        /**
310         * Constructs a new instance of {@link AppliedStrategy}.
311         * @return new AppliedStrategyImpl()
312         */
313        public static AppliedStrategy newInstance()
314        {
315            return new AppliedStrategyImpl();
316        }
317
318        /**
319         * Constructs a new instance of {@link AppliedStrategy}, taking all required and/or
320         * read-only properties as arguments, except for identifiers.
321         * @param appliedPeriods Collection<AppliedPeriod>
322         * @param strategy Strategy
323         * @param location Location
324         * @return newInstance
325         */
326        public static AppliedStrategy newInstance(Collection<AppliedPeriod> appliedPeriods, Strategy strategy, Location location)
327        {
328            final AppliedStrategy entity = new AppliedStrategyImpl();
329            entity.setAppliedPeriods(appliedPeriods);
330            entity.setStrategy(strategy);
331            entity.setLocation(location);
332            return entity;
333        }
334
335        /**
336         * Constructs a new instance of {@link AppliedStrategy}, taking all possible properties
337         * (except the identifier(s))as arguments.
338         * @param batchModelAppliedStrategies Collection<BatchModelAppliedStrategy>
339         * @param appliedPeriods Collection<AppliedPeriod>
340         * @param strategy Strategy
341         * @param location Location
342         * @param pmfmAppliedStrategies Collection<PmfmAppliedStrategy>
343         * @return newInstance AppliedStrategy
344         */
345        public static AppliedStrategy newInstance(Collection<BatchModelAppliedStrategy> batchModelAppliedStrategies, Collection<AppliedPeriod> appliedPeriods, Strategy strategy, Location location, Collection<PmfmAppliedStrategy> pmfmAppliedStrategies)
346        {
347            final AppliedStrategy entity = new AppliedStrategyImpl();
348            entity.setBatchModelAppliedStrategies(batchModelAppliedStrategies);
349            entity.setAppliedPeriods(appliedPeriods);
350            entity.setStrategy(strategy);
351            entity.setLocation(location);
352            entity.setPmfmAppliedStrategies(pmfmAppliedStrategies);
353            return entity;
354        }
355    }
356
357    /**
358     * @see Comparable#compareTo
359     */
360    public int compareTo(AppliedStrategy o)
361    {
362        int cmp = 0;
363        if (this.getId() != null)
364        {
365            cmp = this.getId().compareTo(o.getId());
366        }
367        
368        return cmp;
369    }
370// HibernateEntity.vsl merge-point
371// AppliedStrategy.java merge-point
372}