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 for Allegro
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 * <html>
036 * <head>
037 * <style>
038 * p {padding:0px; margin:0px;}
039 * </style>
040 * </head>
041 * <body>
042 * <p>
043 * Role de la personne en relation avec un navire.
044 * </p>
045 * <p>
046 * </p>
047 * <p>
048 * Exemple :
049 * </p>
050 * <p>
051 * - Patron de pêche (<i>Capitaine</i> ou <i>VesselMaster</i>)
052 * </p>
053 * <p>
054 * - Actionnaire
055 * </p>
056 * <p>
057 * - Revendeur att,
058 * </p>
059 * <p>
060 * etc.
061 * </p>
062 * </body>
063 * </html>
064 */
065// HibernateEntity.vsl annotations merge-point
066public abstract class VesselPersonRole
067    implements Serializable, Comparable<VesselPersonRole>
068{
069    /**
070     * The serial version UID of this class. Needed for serialization.
071     */
072    private static final long serialVersionUID = -7688585073932073180L;
073
074    // Generate 5 attributes
075    private Integer id;
076
077    /**
078     * 
079     * @return this.id Integer
080     */
081    public Integer getId()
082    {
083        return this.id;
084    }
085
086    /**
087     * 
088     * @param idIn Integer
089     */
090    public void setId(Integer idIn)
091    {
092        this.id = idIn;
093    }
094
095    private String label;
096
097    /**
098     * 
099     * @return this.label String
100     */
101    public String getLabel()
102    {
103        return this.label;
104    }
105
106    /**
107     * 
108     * @param labelIn String
109     */
110    public void setLabel(String labelIn)
111    {
112        this.label = labelIn;
113    }
114
115    private String name;
116
117    /**
118     * 
119     * @return this.name String
120     */
121    public String getName()
122    {
123        return this.name;
124    }
125
126    /**
127     * 
128     * @param nameIn String
129     */
130    public void setName(String nameIn)
131    {
132        this.name = nameIn;
133    }
134
135    private String description;
136
137    /**
138     * 
139     * @return this.description String
140     */
141    public String getDescription()
142    {
143        return this.description;
144    }
145
146    /**
147     * 
148     * @param descriptionIn String
149     */
150    public void setDescription(String descriptionIn)
151    {
152        this.description = descriptionIn;
153    }
154
155    private Timestamp updateDate;
156
157    /**
158     * 
159     * @return this.updateDate Timestamp
160     */
161    public Timestamp getUpdateDate()
162    {
163        return this.updateDate;
164    }
165
166    /**
167     * 
168     * @param updateDateIn Timestamp
169     */
170    public void setUpdateDate(Timestamp updateDateIn)
171    {
172        this.updateDate = updateDateIn;
173    }
174
175    // Generate 1 associations
176    /**
177     * Returns <code>true</code> if the argument is an VesselPersonRole instance and all identifiers for this entity
178     * equal the identifiers of the argument entity. Returns <code>false</code> otherwise.
179     */
180    @Override
181    public boolean equals(Object object)
182    {
183        if (this == object)
184        {
185            return true;
186        }
187        if (!(object instanceof VesselPersonRole))
188        {
189            return false;
190        }
191        final VesselPersonRole that = (VesselPersonRole)object;
192        if (this.id == null || that.getId() == null || !this.id.equals(that.getId()))
193        {
194            return false;
195        }
196        return true;
197    }
198
199    /**
200     * Returns a hash code based on this entity's identifiers.
201     */
202    @Override
203    public int hashCode()
204    {
205        int hashCode = 0;
206        hashCode = 29 * hashCode + (this.id == null ? 0 : this.id.hashCode());
207
208        return hashCode;
209    }
210
211    /**
212     * Constructs new instances of {@link VesselPersonRole}.
213     */
214    public static final class Factory
215    {
216        /**
217         * Constructs a new instance of {@link VesselPersonRole}.
218         * @return new VesselPersonRoleImpl()
219         */
220        public static VesselPersonRole newInstance()
221        {
222            return new VesselPersonRoleImpl();
223        }
224
225        /**
226         * Constructs a new instance of {@link VesselPersonRole}, taking all required and/or
227         * read-only properties as arguments, except for identifiers.
228         * @param label String
229         * @param name String
230         * @return newInstance
231         */
232        public static VesselPersonRole newInstance(String label, String name)
233        {
234            final VesselPersonRole entity = new VesselPersonRoleImpl();
235            entity.setLabel(label);
236            entity.setName(name);
237            return entity;
238        }
239
240        /**
241         * Constructs a new instance of {@link VesselPersonRole}, taking all possible properties
242         * (except the identifier(s))as arguments.
243         * @param label String
244         * @param name String
245         * @param description String
246         * @param updateDate Timestamp
247         * @return newInstance VesselPersonRole
248         */
249        public static VesselPersonRole newInstance(String label, String name, String description, Timestamp updateDate)
250        {
251            final VesselPersonRole entity = new VesselPersonRoleImpl();
252            entity.setLabel(label);
253            entity.setName(name);
254            entity.setDescription(description);
255            entity.setUpdateDate(updateDate);
256            return entity;
257        }
258    }
259
260    /**
261     * @see Comparable#compareTo
262     */
263    public int compareTo(VesselPersonRole o)
264    {
265        int cmp = 0;
266        if (this.getId() != null)
267        {
268            cmp = this.getId().compareTo(o.getId());
269        }
270        else
271        {
272            if (this.getLabel() != null)
273            {
274                cmp = (cmp != 0 ? cmp : this.getLabel().compareTo(o.getLabel()));
275            }
276            if (this.getName() != null)
277            {
278                cmp = (cmp != 0 ? cmp : this.getName().compareTo(o.getName()));
279            }
280            if (this.getDescription() != null)
281            {
282                cmp = (cmp != 0 ? cmp : this.getDescription().compareTo(o.getDescription()));
283            }
284            if (this.getUpdateDate() != null)
285            {
286                cmp = (cmp != 0 ? cmp : this.getUpdateDate().compareTo(o.getUpdateDate()));
287            }
288        }
289        return cmp;
290    }
291// HibernateEntity.vsl merge-point
292// VesselPersonRole.java merge-point
293}