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.data.vessel.Vessel;
032import java.io.Serializable;
033
034/**
035 * Permet d'inclure ou d'exlure des navires d'un lieu sur lequel un utilisateur à des droits.
036 */
037// HibernateEntity.vsl annotations merge-point
038public abstract class Program2PersonException
039    implements Serializable, Comparable<Program2PersonException>
040{
041    /**
042     * The serial version UID of this class. Needed for serialization.
043     */
044    private static final long serialVersionUID = -8636551040145566196L;
045
046    private Program2PersonExceptionPK program2PersonExceptionPk;
047
048    /**
049     * Get the composite primary key identifier class
050     * @return program2PersonExceptionPk
051     */
052    public Program2PersonExceptionPK getProgram2PersonExceptionPk()
053    {
054        return this.program2PersonExceptionPk;
055    }
056
057    /**
058     * Set the composite primary key identifier class
059     * @param program2PersonExceptionPkIn
060     */
061    public void setProgram2PersonExceptionPk(Program2PersonExceptionPK program2PersonExceptionPkIn) {
062        this.program2PersonExceptionPk = program2PersonExceptionPkIn;
063    }
064
065    // Generate 2 attributes
066    private Boolean isExclude;
067
068    /**
069     * <html>
070     * <head>
071     * <style>
072     * p {padding:0px; margin:0px;}
073     * </style>
074     * </head>
075     * <body>
076     * <p>
077     * Permet de gérer les exceptions dans les privilèges<i>, </i>en
078     * indiquant si un navire est inclus ou exclus des privilèges définis dans
079     * <i>Program2Person</i>.
080     * </p>
081     * <p>
082     * </p>
083     * <p>
084     * Si <i>isExclude=vrai</i> (=1), alors le navire est exclus (ne sera pas
085     * accessible).
086     * </p>
087     * <p>
088     * Si <i>isExclude=faux</i> (=0), alors le navire est inclus (c'est à dire
089     * ajouter en plus des autres, comme étant accessible).
090     * </p>
091     * </body>
092     * </html>
093     * @return this.isExclude Boolean
094     */
095    public Boolean isIsExclude()
096    {
097        return this.isExclude;
098    }
099
100    /**
101     * <html>
102     * <head>
103     * <style>
104     * p {padding:0px; margin:0px;}
105     * </style>
106     * </head>
107     * <body>
108     * <p>
109     * Permet de gérer les exceptions dans les privilèges<i>, </i>en
110     * indiquant si un navire est inclus ou exclus des privilèges définis dans
111     * <i>Program2Person</i>.
112     * </p>
113     * <p>
114     * </p>
115     * <p>
116     * Si <i>isExclude=vrai</i> (=1), alors le navire est exclus (ne sera pas
117     * accessible).
118     * </p>
119     * <p>
120     * Si <i>isExclude=faux</i> (=0), alors le navire est inclus (c'est à dire
121     * ajouter en plus des autres, comme étant accessible).
122     * </p>
123     * </body>
124     * </html>
125     * @param isExcludeIn Boolean
126     */
127    public void setIsExclude(Boolean isExcludeIn)
128    {
129        this.isExclude = isExcludeIn;
130    }
131
132    private String description;
133
134    /**
135     * <html>
136     * <head>
137     * <style>
138     * p {padding:0px; margin:0px;}
139     * </style>
140     * </head>
141     * <body>
142     * <p>
143     * Description de l'exception établie. doit être sufisamment court et
144     * explicite pour comprendre pourquoi cette règle a été définie.
145     * </p>
146     * <p>
147     * </p>
148     * <p>
149     * Exemple :
150     * </p>
151     * <p>
152     * - &quot;- port de LO&quot; pour une exclusion des navires du port de Lorient.
153     * </p>
154     * <p>
155     * - &quot;+ port LO&quot; pour une inclusion des navires du port de Lorient.
156     * </p>
157     * </body>
158     * </html>
159     * @return this.description String
160     */
161    public String getDescription()
162    {
163        return this.description;
164    }
165
166    /**
167     * <html>
168     * <head>
169     * <style>
170     * p {padding:0px; margin:0px;}
171     * </style>
172     * </head>
173     * <body>
174     * <p>
175     * Description de l'exception établie. doit être sufisamment court et
176     * explicite pour comprendre pourquoi cette règle a été définie.
177     * </p>
178     * <p>
179     * </p>
180     * <p>
181     * Exemple :
182     * </p>
183     * <p>
184     * - &quot;- port de LO&quot; pour une exclusion des navires du port de Lorient.
185     * </p>
186     * <p>
187     * - &quot;+ port LO&quot; pour une inclusion des navires du port de Lorient.
188     * </p>
189     * </body>
190     * </html>
191     * @param descriptionIn String
192     */
193    public void setDescription(String descriptionIn)
194    {
195        this.description = descriptionIn;
196    }
197
198    // Generate 2 associations
199    private Vessel vessel;
200
201    /**
202     * Navire, ou plus généralement un usager de la ressource.
203     * Peut etre un navire de peche professionnel ou non, un navire scientifique, un pêcheur à pied,
204     * un
205     * groupement de navires, etc.
206     * @return this.vessel Vessel
207     */
208    public Vessel getVessel()
209    {
210        return this.vessel;
211    }
212
213    /**
214     * Navire, ou plus généralement un usager de la ressource.
215     * Peut etre un navire de peche professionnel ou non, un navire scientifique, un pêcheur à pied,
216     * un
217     * groupement de navires, etc.
218     * @param vesselIn Vessel
219     */
220    public void setVessel(Vessel vesselIn)
221    {
222        this.vessel = vesselIn;
223    }
224
225    private Program2Person program2Person;
226
227    /**
228     * <html>
229     * <head>
230     * <style>
231     * p {padding:0px; margin:0px;}
232     * </style>
233     * </head>
234     * <body>
235     * Définis les privilèges d'un utilsiateur sur un progamme, ou sur un
236     * </body>
237     * </html>
238     * @return this.program2Person Program2Person
239     */
240    public Program2Person getProgram2Person()
241    {
242        return this.program2Person;
243    }
244
245    /**
246     * <html>
247     * <head>
248     * <style>
249     * p {padding:0px; margin:0px;}
250     * </style>
251     * </head>
252     * <body>
253     * Définis les privilèges d'un utilsiateur sur un progamme, ou sur un
254     * </body>
255     * </html>
256     * @param program2PersonIn Program2Person
257     */
258    public void setProgram2Person(Program2Person program2PersonIn)
259    {
260        this.program2Person = program2PersonIn;
261    }
262
263    /**
264     * This entity does not have any identifiers
265     * and is not extending any other entity,
266     * so this method will only return <code>true</code> if the argument reference and <code>this</code>
267     * refer to the same object.
268     */
269    @Override
270    public boolean equals(Object object)
271    {
272        return super.equals(object);
273    }
274
275    /**
276     * This entity does not have any identifiers
277     * and is not extending any other entity,
278     * so this method will only take the identifiers of this entity into account when calculating the hash code.
279     */
280    @Override
281    public int hashCode()
282    {
283        return super.hashCode();
284    }
285
286    /**
287     * Constructs new instances of {@link Program2PersonException}.
288     */
289    public static final class Factory
290    {
291        /**
292         * Constructs a new instance of {@link Program2PersonException}.
293         * @return new Program2PersonExceptionImpl()
294         */
295        public static Program2PersonException newInstance()
296        {
297            return new Program2PersonExceptionImpl();
298        }
299
300        /**
301         * Constructs a new instance of {@link Program2PersonException}, taking all required and/or
302         * read-only properties as arguments, except for identifiers.
303         * @param isExclude Boolean
304         * @param vessel Vessel
305         * @param program2Person Program2Person
306         * @return newInstance
307         */
308        public static Program2PersonException newInstance(Boolean isExclude, Vessel vessel, Program2Person program2Person)
309        {
310            final Program2PersonException entity = new Program2PersonExceptionImpl();
311            entity.setIsExclude(isExclude);
312            entity.setVessel(vessel);
313            entity.setProgram2Person(program2Person);
314            return entity;
315        }
316
317        /**
318         * Constructs a new instance of {@link Program2PersonException}, taking all possible properties
319         * (except the identifier(s))as arguments.
320         * @param isExclude Boolean
321         * @param description String
322         * @param vessel Vessel
323         * @param program2Person Program2Person
324         * @return newInstance Program2PersonException
325         */
326        public static Program2PersonException newInstance(Boolean isExclude, String description, Vessel vessel, Program2Person program2Person)
327        {
328            final Program2PersonException entity = new Program2PersonExceptionImpl();
329            entity.setIsExclude(isExclude);
330            entity.setDescription(description);
331            entity.setVessel(vessel);
332            entity.setProgram2Person(program2Person);
333            return entity;
334        }
335    }
336
337    /**
338     * @see Comparable#compareTo
339     */
340    public int compareTo(Program2PersonException o)
341    {
342        int cmp = 0;
343        if (this.getProgram2PersonExceptionPk() != null)
344        {
345            cmp = this.getProgram2PersonExceptionPk().compareTo(o.getProgram2PersonExceptionPk());
346        }
347            if (this.isIsExclude() != null)
348            {
349                cmp = (cmp != 0 ? cmp : this.isIsExclude().compareTo(o.isIsExclude()));
350            }
351            if (this.getDescription() != null)
352            {
353                cmp = (cmp != 0 ? cmp : this.getDescription().compareTo(o.getDescription()));
354            }
355        return cmp;
356    }
357// HibernateEntity.vsl merge-point
358// Program2PersonException.java merge-point
359}