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.playground;
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.survey.fishingTrip.FishingTrip;
032import java.io.Serializable;
033import java.sql.Timestamp;
034
035/**
036 * Armateur de navire.
037 * A interpreter (une fois les données connues) et remodeliser.
038 * ref : flux SACAPT
039 */
040// HibernateEntity.vsl annotations merge-point
041public abstract class PlaygroundVesselOwner
042    implements Serializable, Comparable<PlaygroundVesselOwner>
043{
044    /**
045     * The serial version UID of this class. Needed for serialization.
046     */
047    private static final long serialVersionUID = -4727020393650273882L;
048
049    // Generate 8 attributes
050    private Integer id;
051
052    /**
053     * 
054     * @return this.id Integer
055     */
056    public Integer getId()
057    {
058        return this.id;
059    }
060
061    /**
062     * 
063     * @param idIn Integer
064     */
065    public void setId(Integer idIn)
066    {
067        this.id = idIn;
068    }
069
070    private String code;
071
072    /**
073     * 
074     * @return this.code String
075     */
076    public String getCode()
077    {
078        return this.code;
079    }
080
081    /**
082     * 
083     * @param codeIn String
084     */
085    public void setCode(String codeIn)
086    {
087        this.code = codeIn;
088    }
089
090    private String lastname;
091
092    /**
093     * 
094     * @return this.lastname String
095     */
096    public String getLastname()
097    {
098        return this.lastname;
099    }
100
101    /**
102     * 
103     * @param lastnameIn String
104     */
105    public void setLastname(String lastnameIn)
106    {
107        this.lastname = lastnameIn;
108    }
109
110    private String firstname;
111
112    /**
113     * 
114     * @return this.firstname String
115     */
116    public String getFirstname()
117    {
118        return this.firstname;
119    }
120
121    /**
122     * 
123     * @param firstnameIn String
124     */
125    public void setFirstname(String firstnameIn)
126    {
127        this.firstname = firstnameIn;
128    }
129
130    private String street;
131
132    /**
133     * 
134     * @return this.street String
135     */
136    public String getStreet()
137    {
138        return this.street;
139    }
140
141    /**
142     * 
143     * @param streetIn String
144     */
145    public void setStreet(String streetIn)
146    {
147        this.street = streetIn;
148    }
149
150    private String zipCode;
151
152    /**
153     * 
154     * @return this.zipCode String
155     */
156    public String getZipCode()
157    {
158        return this.zipCode;
159    }
160
161    /**
162     * 
163     * @param zipCodeIn String
164     */
165    public void setZipCode(String zipCodeIn)
166    {
167        this.zipCode = zipCodeIn;
168    }
169
170    private String city;
171
172    /**
173     * 
174     * @return this.city String
175     */
176    public String getCity()
177    {
178        return this.city;
179    }
180
181    /**
182     * 
183     * @param cityIn String
184     */
185    public void setCity(String cityIn)
186    {
187        this.city = cityIn;
188    }
189
190    private Timestamp updateDate;
191
192    /**
193     * 
194     * @return this.updateDate Timestamp
195     */
196    public Timestamp getUpdateDate()
197    {
198        return this.updateDate;
199    }
200
201    /**
202     * 
203     * @param updateDateIn Timestamp
204     */
205    public void setUpdateDate(Timestamp updateDateIn)
206    {
207        this.updateDate = updateDateIn;
208    }
209
210    // Generate 1 associations
211    private FishingTrip fishingTrip;
212
213    /**
214     * Voyage en mer, ayant pour vocation une activité de peche (peut etre une campagnes halieutique
215     * ou une
216     * marée d'un navire professionnel, etc.)
217     * Un voyage peut représenter type de données :
218     * - Une marée observée (en mer, au débarquement), qui désigne une marée de pêche
219     * professionnelle au
220     * cours de laquelle des relevés sont effectués par un observateur.
221     * - Une marée déclarée. Principalement issue du log book électronique (flux SACAPT). Une marée
222     * déclarée peut etre un ensemble de marée ou de sous-ensembles de marée (Exemple de la fiche de
223     * peche)
224     * - une sortie effectuée lors d"une campagne scientifique
225     * @return this.fishingTrip FishingTrip
226     */
227    public FishingTrip getFishingTrip()
228    {
229        return this.fishingTrip;
230    }
231
232    /**
233     * Voyage en mer, ayant pour vocation une activité de peche (peut etre une campagnes halieutique
234     * ou une
235     * marée d'un navire professionnel, etc.)
236     * Un voyage peut représenter type de données :
237     * - Une marée observée (en mer, au débarquement), qui désigne une marée de pêche
238     * professionnelle au
239     * cours de laquelle des relevés sont effectués par un observateur.
240     * - Une marée déclarée. Principalement issue du log book électronique (flux SACAPT). Une marée
241     * déclarée peut etre un ensemble de marée ou de sous-ensembles de marée (Exemple de la fiche de
242     * peche)
243     * - une sortie effectuée lors d"une campagne scientifique
244     * @param fishingTripIn FishingTrip
245     */
246    public void setFishingTrip(FishingTrip fishingTripIn)
247    {
248        this.fishingTrip = fishingTripIn;
249    }
250
251    /**
252     * Returns <code>true</code> if the argument is an PlaygroundVesselOwner instance and all identifiers for this entity
253     * equal the identifiers of the argument entity. Returns <code>false</code> otherwise.
254     */
255    @Override
256    public boolean equals(Object object)
257    {
258        if (this == object)
259        {
260            return true;
261        }
262        if (!(object instanceof PlaygroundVesselOwner))
263        {
264            return false;
265        }
266        final PlaygroundVesselOwner that = (PlaygroundVesselOwner)object;
267        if (this.id == null || that.getId() == null || !this.id.equals(that.getId()))
268        {
269            return false;
270        }
271        return true;
272    }
273
274    /**
275     * Returns a hash code based on this entity's identifiers.
276     */
277    @Override
278    public int hashCode()
279    {
280        int hashCode = 0;
281        hashCode = 29 * hashCode + (this.id == null ? 0 : this.id.hashCode());
282
283        return hashCode;
284    }
285
286    /**
287     * Constructs new instances of {@link PlaygroundVesselOwner}.
288     */
289    public static final class Factory
290    {
291        /**
292         * Constructs a new instance of {@link PlaygroundVesselOwner}.
293         * @return new PlaygroundVesselOwnerImpl()
294         */
295        public static PlaygroundVesselOwner newInstance()
296        {
297            return new PlaygroundVesselOwnerImpl();
298        }
299
300        /**
301         * Constructs a new instance of {@link PlaygroundVesselOwner}, taking all required and/or
302         * read-only properties as arguments, except for identifiers.
303         * @param code String
304         * @param updateDate Timestamp
305         * @return newInstance
306         */
307        public static PlaygroundVesselOwner newInstance(String code, Timestamp updateDate)
308        {
309            final PlaygroundVesselOwner entity = new PlaygroundVesselOwnerImpl();
310            entity.setCode(code);
311            entity.setUpdateDate(updateDate);
312            return entity;
313        }
314
315        /**
316         * Constructs a new instance of {@link PlaygroundVesselOwner}, taking all possible properties
317         * (except the identifier(s))as arguments.
318         * @param code String
319         * @param lastname String
320         * @param firstname String
321         * @param street String
322         * @param zipCode String
323         * @param city String
324         * @param updateDate Timestamp
325         * @param fishingTrip FishingTrip
326         * @return newInstance PlaygroundVesselOwner
327         */
328        public static PlaygroundVesselOwner newInstance(String code, String lastname, String firstname, String street, String zipCode, String city, Timestamp updateDate, FishingTrip fishingTrip)
329        {
330            final PlaygroundVesselOwner entity = new PlaygroundVesselOwnerImpl();
331            entity.setCode(code);
332            entity.setLastname(lastname);
333            entity.setFirstname(firstname);
334            entity.setStreet(street);
335            entity.setZipCode(zipCode);
336            entity.setCity(city);
337            entity.setUpdateDate(updateDate);
338            entity.setFishingTrip(fishingTrip);
339            return entity;
340        }
341    }
342
343    /**
344     * @see Comparable#compareTo
345     */
346    public int compareTo(PlaygroundVesselOwner o)
347    {
348        int cmp = 0;
349        if (this.getId() != null)
350        {
351            cmp = this.getId().compareTo(o.getId());
352        }
353        else
354        {
355            if (this.getCode() != null)
356            {
357                cmp = (cmp != 0 ? cmp : this.getCode().compareTo(o.getCode()));
358            }
359            if (this.getLastname() != null)
360            {
361                cmp = (cmp != 0 ? cmp : this.getLastname().compareTo(o.getLastname()));
362            }
363            if (this.getFirstname() != null)
364            {
365                cmp = (cmp != 0 ? cmp : this.getFirstname().compareTo(o.getFirstname()));
366            }
367            if (this.getStreet() != null)
368            {
369                cmp = (cmp != 0 ? cmp : this.getStreet().compareTo(o.getStreet()));
370            }
371            if (this.getZipCode() != null)
372            {
373                cmp = (cmp != 0 ? cmp : this.getZipCode().compareTo(o.getZipCode()));
374            }
375            if (this.getCity() != null)
376            {
377                cmp = (cmp != 0 ? cmp : this.getCity().compareTo(o.getCity()));
378            }
379            if (this.getUpdateDate() != null)
380            {
381                cmp = (cmp != 0 ? cmp : this.getUpdateDate().compareTo(o.getUpdateDate()));
382            }
383        }
384        return cmp;
385    }
386// HibernateEntity.vsl merge-point
387// PlaygroundVesselOwner.java merge-point
388}