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.quadrige3.core.dao.referential.eunis;
7   
8   /*-
9    * #%L
10   * Quadrige3 Core :: Client API
11   * %%
12   * Copyright (C) 2017 - 2024 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  import java.io.Serializable;
29  import java.sql.Timestamp;
30  
31  /**
32   * Permet de définir les différentes équivalences entre les typologie EUNIS.
33   */
34  // HibernateEntity.vsl annotations merge-point
35  public abstract class EunisEquivalence
36      implements Serializable, Comparable<EunisEquivalence>
37  {
38      /**
39       * The serial version UID of this class. Needed for serialization.
40       */
41      private static final long serialVersionUID = -6565558200307778057L;
42  
43      // Generate 3 attributes
44      private Integer eunisEquivId;
45  
46      /**
47       * Identifiant interne de l'équivalence
48       * @return this.eunisEquivId Integer
49       */
50      public Integer getEunisEquivId()
51      {
52          return this.eunisEquivId;
53      }
54  
55      /**
56       * Identifiant interne de l'équivalence
57       * @param eunisEquivIdIn Integer
58       */
59      public void setEunisEquivId(Integer eunisEquivIdIn)
60      {
61          this.eunisEquivId = eunisEquivIdIn;
62      }
63  
64      private String eunisEquivCm;
65  
66      /**
67       * Commentaire sur l'équivalence
68       * @return this.eunisEquivCm String
69       */
70      public String getEunisEquivCm()
71      {
72          return this.eunisEquivCm;
73      }
74  
75      /**
76       * Commentaire sur l'équivalence
77       * @param eunisEquivCmIn String
78       */
79      public void setEunisEquivCm(String eunisEquivCmIn)
80      {
81          this.eunisEquivCm = eunisEquivCmIn;
82      }
83  
84      private Timestamp updateDt;
85  
86      /**
87       * Date de modification de l'objet, mise à jour par le système
88       * @return this.updateDt Timestamp
89       */
90      public Timestamp getUpdateDt()
91      {
92          return this.updateDt;
93      }
94  
95      /**
96       * Date de modification de l'objet, mise à jour par le système
97       * @param updateDtIn Timestamp
98       */
99      public void setUpdateDt(Timestamp updateDtIn)
100     {
101         this.updateDt = updateDtIn;
102     }
103 
104     // Generate 3 associations
105     private EunisEquivCodeTypology eunisEquivCodeTypCd;
106 
107     /**
108      * Définit les différents type d'équivalence qui peuvent être fait entre code EUNIS
109      * @return this.eunisEquivCodeTypCd EunisEquivCodeTypology
110      */
111     public EunisEquivCodeTypology getEunisEquivCodeTypCd()
112     {
113         return this.eunisEquivCodeTypCd;
114     }
115 
116     /**
117      * Définit les différents type d'équivalence qui peuvent être fait entre code EUNIS
118      * @param eunisEquivCodeTypCdIn EunisEquivCodeTypology
119      */
120     public void setEunisEquivCodeTypCd(EunisEquivCodeTypology eunisEquivCodeTypCdIn)
121     {
122         this.eunisEquivCodeTypCd = eunisEquivCodeTypCdIn;
123     }
124 
125     private EunisTypology oldEunisTypId;
126 
127     /**
128      * Typologie EUNIS
129      * @return this.oldEunisTypId EunisTypology
130      */
131     public EunisTypology getOldEunisTypId()
132     {
133         return this.oldEunisTypId;
134     }
135 
136     /**
137      * Typologie EUNIS
138      * @param oldEunisTypIdIn EunisTypology
139      */
140     public void setOldEunisTypId(EunisTypology oldEunisTypIdIn)
141     {
142         this.oldEunisTypId = oldEunisTypIdIn;
143     }
144 
145     private EunisTypology newEunisTypId;
146 
147     /**
148      * Typologie EUNIS
149      * @return this.newEunisTypId EunisTypology
150      */
151     public EunisTypology getNewEunisTypId()
152     {
153         return this.newEunisTypId;
154     }
155 
156     /**
157      * Typologie EUNIS
158      * @param newEunisTypIdIn EunisTypology
159      */
160     public void setNewEunisTypId(EunisTypology newEunisTypIdIn)
161     {
162         this.newEunisTypId = newEunisTypIdIn;
163     }
164 
165     /**
166      * Returns <code>true</code> if the argument is an EunisEquivalence instance and all identifiers for this entity
167      * equal the identifiers of the argument entity. Returns <code>false</code> otherwise.
168      */
169     @Override
170     public boolean equals(Object object)
171     {
172         if (this == object)
173         {
174             return true;
175         }
176         if (!(object instanceof EunisEquivalence))
177         {
178             return false;
179         }
180         final EunisEquivalence that = (EunisEquivalence)object;
181         if (this.eunisEquivId == null || that.getEunisEquivId() == null || !this.eunisEquivId.equals(that.getEunisEquivId()))
182         {
183             return false;
184         }
185         return true;
186     }
187 
188     /**
189      * Returns a hash code based on this entity's identifiers.
190      */
191     @Override
192     public int hashCode()
193     {
194         int hashCode = 0;
195         hashCode = 29 * hashCode + (this.eunisEquivId == null ? 0 : this.eunisEquivId.hashCode());
196 
197         return hashCode;
198     }
199 
200     /**
201      * Constructs new instances of {@link EunisEquivalence}.
202      */
203     public static final class Factory
204     {
205         /**
206          * Constructs a new instance of {@link EunisEquivalence}.
207          * @return new EunisEquivalenceImpl()
208          */
209         public static EunisEquivalence newInstance()
210         {
211             return new EunisEquivalenceImpl();
212         }
213 
214         /**
215          * Constructs a new instance of {@link EunisEquivalence}, taking all required and/or
216          * read-only properties as arguments, except for identifiers.
217          * @param eunisEquivCodeTypCd EunisEquivCodeTypology
218          * @param oldEunisTypId EunisTypology
219          * @param newEunisTypId EunisTypology
220          * @return newInstance
221          */
222         public static EunisEquivalence newInstance(EunisEquivCodeTypology eunisEquivCodeTypCd, EunisTypology oldEunisTypId, EunisTypology newEunisTypId)
223         {
224             final EunisEquivalence entity = new EunisEquivalenceImpl();
225             entity.setEunisEquivCodeTypCd(eunisEquivCodeTypCd);
226             entity.setOldEunisTypId(oldEunisTypId);
227             entity.setNewEunisTypId(newEunisTypId);
228             return entity;
229         }
230 
231         /**
232          * Constructs a new instance of {@link EunisEquivalence}, taking all possible properties
233          * (except the identifier(s))as arguments.
234          * @param eunisEquivCm String
235          * @param updateDt Timestamp
236          * @param eunisEquivCodeTypCd EunisEquivCodeTypology
237          * @param oldEunisTypId EunisTypology
238          * @param newEunisTypId EunisTypology
239          * @return newInstance EunisEquivalence
240          */
241         public static EunisEquivalence newInstance(String eunisEquivCm, Timestamp updateDt, EunisEquivCodeTypology eunisEquivCodeTypCd, EunisTypology oldEunisTypId, EunisTypology newEunisTypId)
242         {
243             final EunisEquivalence entity = new EunisEquivalenceImpl();
244             entity.setEunisEquivCm(eunisEquivCm);
245             entity.setUpdateDt(updateDt);
246             entity.setEunisEquivCodeTypCd(eunisEquivCodeTypCd);
247             entity.setOldEunisTypId(oldEunisTypId);
248             entity.setNewEunisTypId(newEunisTypId);
249             return entity;
250         }
251     }
252 
253     /**
254      * @see Comparable#compareTo
255      */
256     public int compareTo(EunisEquivalence o)
257     {
258         int cmp = 0;
259         if (this.getEunisEquivId() != null)
260         {
261             cmp = this.getEunisEquivId().compareTo(o.getEunisEquivId());
262         }
263         else
264         {
265             if (this.getEunisEquivCm() != null)
266             {
267                 cmp = (cmp != 0 ? cmp : this.getEunisEquivCm().compareTo(o.getEunisEquivCm()));
268             }
269             if (this.getUpdateDt() != null)
270             {
271                 cmp = (cmp != 0 ? cmp : this.getUpdateDt().compareTo(o.getUpdateDt()));
272             }
273         }
274         return cmp;
275     }
276 // HibernateEntity.vsl merge-point
277 // EunisEquivalence.java merge-point
278 }