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;
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  import java.util.Date;
31  
32  /**
33   * Liste les engins d'analyse ou de prélèvement (au sens marque/modèle et non numéro de série).
34   */
35  // HibernateEntity.vsl annotations merge-point
36  public abstract class AnalysisInstrument
37      implements Serializable, Comparable<AnalysisInstrument>
38  {
39      /**
40       * The serial version UID of this class. Needed for serialization.
41       */
42      private static final long serialVersionUID = 7181556740685380495L;
43  
44      // Generate 6 attributes
45      private Integer analInstId;
46  
47      /**
48       * Identifiant de l'engin
49       * @return this.analInstId Integer
50       */
51      public Integer getAnalInstId()
52      {
53          return this.analInstId;
54      }
55  
56      /**
57       * Identifiant de l'engin
58       * @param analInstIdIn Integer
59       */
60      public void setAnalInstId(Integer analInstIdIn)
61      {
62          this.analInstId = analInstIdIn;
63      }
64  
65      private String analInstNm;
66  
67      /**
68       * Libellé de l'engin d'analyse
69       * @return this.analInstNm String
70       */
71      public String getAnalInstNm()
72      {
73          return this.analInstNm;
74      }
75  
76      /**
77       * Libellé de l'engin d'analyse
78       * @param analInstNmIn String
79       */
80      public void setAnalInstNm(String analInstNmIn)
81      {
82          this.analInstNm = analInstNmIn;
83      }
84  
85      private String analInstDc;
86  
87      /**
88       * Description de l'engin
89       * @return this.analInstDc String
90       */
91      public String getAnalInstDc()
92      {
93          return this.analInstDc;
94      }
95  
96      /**
97       * Description de l'engin
98       * @param analInstDcIn String
99       */
100     public void setAnalInstDc(String analInstDcIn)
101     {
102         this.analInstDc = analInstDcIn;
103     }
104 
105     private Timestamp updateDt;
106 
107     /**
108      * Date de modification de l'objet, mise à jour par le système
109      * @return this.updateDt Timestamp
110      */
111     public Timestamp getUpdateDt()
112     {
113         return this.updateDt;
114     }
115 
116     /**
117      * Date de modification de l'objet, mise à jour par le système
118      * @param updateDtIn Timestamp
119      */
120     public void setUpdateDt(Timestamp updateDtIn)
121     {
122         this.updateDt = updateDtIn;
123     }
124 
125     private String analInstCm;
126 
127     /**
128      * 
129      * @return this.analInstCm String
130      */
131     public String getAnalInstCm()
132     {
133         return this.analInstCm;
134     }
135 
136     /**
137      * 
138      * @param analInstCmIn String
139      */
140     public void setAnalInstCm(String analInstCmIn)
141     {
142         this.analInstCm = analInstCmIn;
143     }
144 
145     private Date creationDt;
146 
147     /**
148      * 
149      * @return this.creationDt Date
150      */
151     public Date getCreationDt()
152     {
153         return this.creationDt;
154     }
155 
156     /**
157      * 
158      * @param creationDtIn Date
159      */
160     public void setCreationDt(Date creationDtIn)
161     {
162         this.creationDt = creationDtIn;
163     }
164 
165     // Generate 5 associations
166     private Status status;
167 
168     /**
169      * Liste des états possibles d'un objet.
170      * @return this.status Status
171      */
172     public Status getStatus()
173     {
174         return this.status;
175     }
176 
177     /**
178      * Liste des états possibles d'un objet.
179      * @param statusIn Status
180      */
181     public void setStatus(Status statusIn)
182     {
183         this.status = statusIn;
184     }
185 
186     /**
187      * Returns <code>true</code> if the argument is an AnalysisInstrument instance and all identifiers for this entity
188      * equal the identifiers of the argument entity. Returns <code>false</code> otherwise.
189      */
190     @Override
191     public boolean equals(Object object)
192     {
193         if (this == object)
194         {
195             return true;
196         }
197         if (!(object instanceof AnalysisInstrument))
198         {
199             return false;
200         }
201         final AnalysisInstrument that = (AnalysisInstrument)object;
202         if (this.analInstId == null || that.getAnalInstId() == null || !this.analInstId.equals(that.getAnalInstId()))
203         {
204             return false;
205         }
206         return true;
207     }
208 
209     /**
210      * Returns a hash code based on this entity's identifiers.
211      */
212     @Override
213     public int hashCode()
214     {
215         int hashCode = 0;
216         hashCode = 29 * hashCode + (this.analInstId == null ? 0 : this.analInstId.hashCode());
217 
218         return hashCode;
219     }
220 
221     /**
222      * Constructs new instances of {@link AnalysisInstrument}.
223      */
224     public static final class Factory
225     {
226         /**
227          * Constructs a new instance of {@link AnalysisInstrument}.
228          * @return new AnalysisInstrumentImpl()
229          */
230         public static AnalysisInstrument newInstance()
231         {
232             return new AnalysisInstrumentImpl();
233         }
234 
235         /**
236          * Constructs a new instance of {@link AnalysisInstrument}, taking all required and/or
237          * read-only properties as arguments, except for identifiers.
238          * @param analInstNm String
239          * @param status Status
240          * @return newInstance
241          */
242         public static AnalysisInstrument newInstance(String analInstNm, Status status)
243         {
244             final AnalysisInstrument entity = new AnalysisInstrumentImpl();
245             entity.setAnalInstNm(analInstNm);
246             entity.setStatus(status);
247             return entity;
248         }
249 
250         /**
251          * Constructs a new instance of {@link AnalysisInstrument}, taking all possible properties
252          * (except the identifier(s))as arguments.
253          * @param analInstNm String
254          * @param analInstDc String
255          * @param updateDt Timestamp
256          * @param analInstCm String
257          * @param creationDt Date
258          * @param status Status
259          * @return newInstance AnalysisInstrument
260          */
261         public static AnalysisInstrument newInstance(String analInstNm, String analInstDc, Timestamp updateDt, String analInstCm, Date creationDt, Status status)
262         {
263             final AnalysisInstrument entity = new AnalysisInstrumentImpl();
264             entity.setAnalInstNm(analInstNm);
265             entity.setAnalInstDc(analInstDc);
266             entity.setUpdateDt(updateDt);
267             entity.setAnalInstCm(analInstCm);
268             entity.setCreationDt(creationDt);
269             entity.setStatus(status);
270             return entity;
271         }
272     }
273 
274     /**
275      * @see Comparable#compareTo
276      */
277     public int compareTo(AnalysisInstrument o)
278     {
279         int cmp = 0;
280         if (this.getAnalInstId() != null)
281         {
282             cmp = this.getAnalInstId().compareTo(o.getAnalInstId());
283         }
284         else
285         {
286             if (this.getAnalInstNm() != null)
287             {
288                 cmp = (cmp != 0 ? cmp : this.getAnalInstNm().compareTo(o.getAnalInstNm()));
289             }
290             if (this.getAnalInstDc() != null)
291             {
292                 cmp = (cmp != 0 ? cmp : this.getAnalInstDc().compareTo(o.getAnalInstDc()));
293             }
294             if (this.getUpdateDt() != null)
295             {
296                 cmp = (cmp != 0 ? cmp : this.getUpdateDt().compareTo(o.getUpdateDt()));
297             }
298             if (this.getAnalInstCm() != null)
299             {
300                 cmp = (cmp != 0 ? cmp : this.getAnalInstCm().compareTo(o.getAnalInstCm()));
301             }
302             if (this.getCreationDt() != null)
303             {
304                 cmp = (cmp != 0 ? cmp : this.getCreationDt().compareTo(o.getCreationDt()));
305             }
306         }
307         return cmp;
308     }
309 // HibernateEntity.vsl merge-point
310 // AnalysisInstrument.java merge-point
311 }