View Javadoc
1   // license-header java merge-point
2   //
3   // Attention: Generated code! Do not modify by hand!
4   // Generated by: hibernate/HibernateEntity.vsl in andromda-hibernate-cartridge.
5   //
6   package fr.ifremer.quadrige2.core.dao.referential.eunis;
7   
8   /*-
9    * #%L
10   * Quadrige2 Core :: Server API
11   * %%
12   * Copyright (C) 2017 Ifremer
13   * %%
14   * This program is free software: you can redistribute it and/or modify
15   * it under the terms of the GNU Affero General Public License as published by
16   * the Free Software Foundation, either version 3 of the License, or
17   * (at your option) any later version.
18   * 
19   * This program is distributed in the hope that it will be useful,
20   * but WITHOUT ANY WARRANTY; without even the implied warranty of
21   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
22   * GNU General Public License for more details.
23   * 
24   * You should have received a copy of the GNU Affero General Public License
25   * along with this program.  If not, see <http://www.gnu.org/licenses/>.
26   * #L%
27   */
28  
29  import java.io.Serializable;
30  import java.sql.Timestamp;
31  
32  /**
33   * Permet de définir les différentes équivalences entre les typologie EUNIS.
34   */
35  // HibernateEntity.vsl annotations merge-point
36  public abstract class EunisEquivalence
37      implements Serializable, Comparable<EunisEquivalence>
38  {
39      /**
40       * The serial version UID of this class. Needed for serialization.
41       */
42      private static final long serialVersionUID = -6565558200307778057L;
43  
44      // Generate 3 attributes
45      private Integer eunisEquivId;
46  
47      /**
48       * Identifiant interne de l'équivalence
49       * @return this.eunisEquivId Integer
50       */
51      public Integer getEunisEquivId()
52      {
53          return this.eunisEquivId;
54      }
55  
56      /**
57       * Identifiant interne de l'équivalence
58       * @param eunisEquivIdIn Integer
59       */
60      public void setEunisEquivId(Integer eunisEquivIdIn)
61      {
62          this.eunisEquivId = eunisEquivIdIn;
63      }
64  
65      private String eunisEquivCm;
66  
67      /**
68       * Commentaire sur l'équivalence
69       * @return this.eunisEquivCm String
70       */
71      public String getEunisEquivCm()
72      {
73          return this.eunisEquivCm;
74      }
75  
76      /**
77       * Commentaire sur l'équivalence
78       * @param eunisEquivCmIn String
79       */
80      public void setEunisEquivCm(String eunisEquivCmIn)
81      {
82          this.eunisEquivCm = eunisEquivCmIn;
83      }
84  
85      private Timestamp updateDt;
86  
87      /**
88       * Date de modification de l'objet, mise à jour par le système
89       * @return this.updateDt Timestamp
90       */
91      public Timestamp getUpdateDt()
92      {
93          return this.updateDt;
94      }
95  
96      /**
97       * Date de modification de l'objet, mise à jour par le système
98       * @param updateDtIn Timestamp
99       */
100     public void setUpdateDt(Timestamp updateDtIn)
101     {
102         this.updateDt = updateDtIn;
103     }
104 
105     // Generate 3 associations
106     private EunisEquivCodeTypology eunisEquivCodeTypCd;
107 
108     /**
109      * Définit les différents type d'équivalence qui peuvent être fait entre code EUNIS
110      * @return this.eunisEquivCodeTypCd EunisEquivCodeTypology
111      */
112     public EunisEquivCodeTypology getEunisEquivCodeTypCd()
113     {
114         return this.eunisEquivCodeTypCd;
115     }
116 
117     /**
118      * Définit les différents type d'équivalence qui peuvent être fait entre code EUNIS
119      * @param eunisEquivCodeTypCdIn EunisEquivCodeTypology
120      */
121     public void setEunisEquivCodeTypCd(EunisEquivCodeTypology eunisEquivCodeTypCdIn)
122     {
123         this.eunisEquivCodeTypCd = eunisEquivCodeTypCdIn;
124     }
125 
126     private EunisTypology oldEunisTypId;
127 
128     /**
129      * Typologie EUNIS
130      * @return this.oldEunisTypId EunisTypology
131      */
132     public EunisTypology getOldEunisTypId()
133     {
134         return this.oldEunisTypId;
135     }
136 
137     /**
138      * Typologie EUNIS
139      * @param oldEunisTypIdIn EunisTypology
140      */
141     public void setOldEunisTypId(EunisTypology oldEunisTypIdIn)
142     {
143         this.oldEunisTypId = oldEunisTypIdIn;
144     }
145 
146     private EunisTypology newEunisTypId;
147 
148     /**
149      * Typologie EUNIS
150      * @return this.newEunisTypId EunisTypology
151      */
152     public EunisTypology getNewEunisTypId()
153     {
154         return this.newEunisTypId;
155     }
156 
157     /**
158      * Typologie EUNIS
159      * @param newEunisTypIdIn EunisTypology
160      */
161     public void setNewEunisTypId(EunisTypology newEunisTypIdIn)
162     {
163         this.newEunisTypId = newEunisTypIdIn;
164     }
165 
166     /**
167      * Returns <code>true</code> if the argument is an EunisEquivalence instance and all identifiers for this entity
168      * equal the identifiers of the argument entity. Returns <code>false</code> otherwise.
169      */
170     @Override
171     public boolean equals(Object object)
172     {
173         if (this == object)
174         {
175             return true;
176         }
177         if (!(object instanceof EunisEquivalence))
178         {
179             return false;
180         }
181         final EunisEquivalence that = (EunisEquivalence)object;
182         if (this.eunisEquivId == null || that.getEunisEquivId() == null || !this.eunisEquivId.equals(that.getEunisEquivId()))
183         {
184             return false;
185         }
186         return true;
187     }
188 
189     /**
190      * Returns a hash code based on this entity's identifiers.
191      */
192     @Override
193     public int hashCode()
194     {
195         int hashCode = 0;
196         hashCode = 29 * hashCode + (this.eunisEquivId == null ? 0 : this.eunisEquivId.hashCode());
197 
198         return hashCode;
199     }
200 
201     /**
202      * Constructs new instances of {@link EunisEquivalence}.
203      */
204     public static final class Factory
205     {
206         /**
207          * Constructs a new instance of {@link EunisEquivalence}.
208          * @return new EunisEquivalenceImpl()
209          */
210         public static EunisEquivalence newInstance()
211         {
212             return new EunisEquivalenceImpl();
213         }
214 
215         /**
216          * Constructs a new instance of {@link EunisEquivalence}, taking all required and/or
217          * read-only properties as arguments, except for identifiers.
218          * @param updateDt Timestamp
219          * @param eunisEquivCodeTypCd EunisEquivCodeTypology
220          * @param oldEunisTypId EunisTypology
221          * @param newEunisTypId EunisTypology
222          * @return newInstance
223          */
224         public static EunisEquivalence newInstance(Timestamp updateDt, EunisEquivCodeTypology eunisEquivCodeTypCd, EunisTypology oldEunisTypId, EunisTypology newEunisTypId)
225         {
226             final EunisEquivalence entity = new EunisEquivalenceImpl();
227             entity.setUpdateDt(updateDt);
228             entity.setEunisEquivCodeTypCd(eunisEquivCodeTypCd);
229             entity.setOldEunisTypId(oldEunisTypId);
230             entity.setNewEunisTypId(newEunisTypId);
231             return entity;
232         }
233 
234         /**
235          * Constructs a new instance of {@link EunisEquivalence}, taking all possible properties
236          * (except the identifier(s))as arguments.
237          * @param eunisEquivCm String
238          * @param updateDt Timestamp
239          * @param eunisEquivCodeTypCd EunisEquivCodeTypology
240          * @param oldEunisTypId EunisTypology
241          * @param newEunisTypId EunisTypology
242          * @return newInstance EunisEquivalence
243          */
244         public static EunisEquivalence newInstance(String eunisEquivCm, Timestamp updateDt, EunisEquivCodeTypology eunisEquivCodeTypCd, EunisTypology oldEunisTypId, EunisTypology newEunisTypId)
245         {
246             final EunisEquivalence entity = new EunisEquivalenceImpl();
247             entity.setEunisEquivCm(eunisEquivCm);
248             entity.setUpdateDt(updateDt);
249             entity.setEunisEquivCodeTypCd(eunisEquivCodeTypCd);
250             entity.setOldEunisTypId(oldEunisTypId);
251             entity.setNewEunisTypId(newEunisTypId);
252             return entity;
253         }
254     }
255 
256     /**
257      * @see Comparable#compareTo
258      */
259     public int compareTo(EunisEquivalence o)
260     {
261         int cmp = 0;
262         if (this.getEunisEquivId() != null)
263         {
264             cmp = this.getEunisEquivId().compareTo(o.getEunisEquivId());
265         }
266         else
267         {
268             if (this.getEunisEquivCm() != null)
269             {
270                 cmp = (cmp != 0 ? cmp : this.getEunisEquivCm().compareTo(o.getEunisEquivCm()));
271             }
272             if (this.getUpdateDt() != null)
273             {
274                 cmp = (cmp != 0 ? cmp : this.getUpdateDt().compareTo(o.getUpdateDt()));
275             }
276         }
277         return cmp;
278     }
279 // HibernateEntity.vsl merge-point
280 // EunisEquivalence.java merge-point
281 }