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.location;
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 java.io.Serializable;
032import java.sql.Timestamp;
033
034/**
035 * Classification d'une hierachie de lieu.
036 * Par exemple :
037 * - lieu territoriaux (Pays, region, port, ...)
038 * - secteurs maritimes (Zone FAO, sous-zone FAO, etc...)
039 * - zone d'effort (B,J,C)
040 * - implantation Ifremer
041 * - laboratoire côtier, ...
042 */
043// HibernateEntity.vsl annotations merge-point
044public abstract class LocationClassification
045    implements Serializable, Comparable<LocationClassification>
046{
047    /**
048     * The serial version UID of this class. Needed for serialization.
049     */
050    private static final long serialVersionUID = -7591433994635112436L;
051
052    // Generate 5 attributes
053    private Integer id;
054
055    /**
056     * 
057     * @return this.id Integer
058     */
059    public Integer getId()
060    {
061        return this.id;
062    }
063
064    /**
065     * 
066     * @param idIn Integer
067     */
068    public void setId(Integer idIn)
069    {
070        this.id = idIn;
071    }
072
073    private String name;
074
075    /**
076     * 
077     * @return this.name String
078     */
079    public String getName()
080    {
081        return this.name;
082    }
083
084    /**
085     * 
086     * @param nameIn String
087     */
088    public void setName(String nameIn)
089    {
090        this.name = nameIn;
091    }
092
093    private String description;
094
095    /**
096     * 
097     * @return this.description String
098     */
099    public String getDescription()
100    {
101        return this.description;
102    }
103
104    /**
105     * 
106     * @param descriptionIn String
107     */
108    public void setDescription(String descriptionIn)
109    {
110        this.description = descriptionIn;
111    }
112
113    private String comments;
114
115    /**
116     * 
117     * @return this.comments String
118     */
119    public String getComments()
120    {
121        return this.comments;
122    }
123
124    /**
125     * 
126     * @param commentsIn String
127     */
128    public void setComments(String commentsIn)
129    {
130        this.comments = commentsIn;
131    }
132
133    private Timestamp updateDate;
134
135    /**
136     * 
137     * @return this.updateDate Timestamp
138     */
139    public Timestamp getUpdateDate()
140    {
141        return this.updateDate;
142    }
143
144    /**
145     * 
146     * @param updateDateIn Timestamp
147     */
148    public void setUpdateDate(Timestamp updateDateIn)
149    {
150        this.updateDate = updateDateIn;
151    }
152
153    // Generate 3 associations
154    /**
155     * Returns <code>true</code> if the argument is an LocationClassification instance and all identifiers for this entity
156     * equal the identifiers of the argument entity. Returns <code>false</code> otherwise.
157     */
158    @Override
159    public boolean equals(Object object)
160    {
161        if (this == object)
162        {
163            return true;
164        }
165        if (!(object instanceof LocationClassification))
166        {
167            return false;
168        }
169        final LocationClassification that = (LocationClassification)object;
170        if (this.id == null || that.getId() == null || !this.id.equals(that.getId()))
171        {
172            return false;
173        }
174        return true;
175    }
176
177    /**
178     * Returns a hash code based on this entity's identifiers.
179     */
180    @Override
181    public int hashCode()
182    {
183        int hashCode = 0;
184        hashCode = 29 * hashCode + (this.id == null ? 0 : this.id.hashCode());
185
186        return hashCode;
187    }
188
189    /**
190     * Constructs new instances of {@link LocationClassification}.
191     */
192    public static final class Factory
193    {
194        /**
195         * Constructs a new instance of {@link LocationClassification}.
196         * @return new LocationClassificationImpl()
197         */
198        public static LocationClassification newInstance()
199        {
200            return new LocationClassificationImpl();
201        }
202
203        /**
204         * Constructs a new instance of {@link LocationClassification}, taking all required and/or
205         * read-only properties as arguments, except for identifiers.
206         * @param name String
207         * @param updateDate Timestamp
208         * @return newInstance
209         */
210        public static LocationClassification newInstance(String name, Timestamp updateDate)
211        {
212            final LocationClassification entity = new LocationClassificationImpl();
213            entity.setName(name);
214            entity.setUpdateDate(updateDate);
215            return entity;
216        }
217
218        /**
219         * Constructs a new instance of {@link LocationClassification}, taking all possible properties
220         * (except the identifier(s))as arguments.
221         * @param name String
222         * @param description String
223         * @param comments String
224         * @param updateDate Timestamp
225         * @return newInstance LocationClassification
226         */
227        public static LocationClassification newInstance(String name, String description, String comments, Timestamp updateDate)
228        {
229            final LocationClassification entity = new LocationClassificationImpl();
230            entity.setName(name);
231            entity.setDescription(description);
232            entity.setComments(comments);
233            entity.setUpdateDate(updateDate);
234            return entity;
235        }
236    }
237
238    /**
239     * @see Comparable#compareTo
240     */
241    public int compareTo(LocationClassification o)
242    {
243        int cmp = 0;
244        if (this.getId() != null)
245        {
246            cmp = this.getId().compareTo(o.getId());
247        }
248        else
249        {
250            if (this.getName() != null)
251            {
252                cmp = (cmp != 0 ? cmp : this.getName().compareTo(o.getName()));
253            }
254            if (this.getDescription() != null)
255            {
256                cmp = (cmp != 0 ? cmp : this.getDescription().compareTo(o.getDescription()));
257            }
258            if (this.getComments() != null)
259            {
260                cmp = (cmp != 0 ? cmp : this.getComments().compareTo(o.getComments()));
261            }
262            if (this.getUpdateDate() != null)
263            {
264                cmp = (cmp != 0 ? cmp : this.getUpdateDate().compareTo(o.getUpdateDate()));
265            }
266        }
267        return cmp;
268    }
269// HibernateEntity.vsl merge-point
270// LocationClassification.java merge-point
271}