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