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.system;
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 fr.ifremer.quadrige3.core.dao.administration.user.Quser;
29  import java.io.Serializable;
30  import java.sql.Timestamp;
31  import java.util.Date;
32  
33  /**
34   * Liste des taches de fond lancées
35   */
36  // HibernateEntity.vsl annotations merge-point
37  public abstract class Job
38      implements Serializable, Comparable<Job>
39  {
40      /**
41       * The serial version UID of this class. Needed for serialization.
42       */
43      private static final long serialVersionUID = -2808208541635962580L;
44  
45      // Generate 8 attributes
46      private Integer jobId;
47  
48      /**
49       * identifiant interne de la tache
50       * @return this.jobId Integer
51       */
52      public Integer getJobId()
53      {
54          return this.jobId;
55      }
56  
57      /**
58       * identifiant interne de la tache
59       * @param jobIdIn Integer
60       */
61      public void setJobId(Integer jobIdIn)
62      {
63          this.jobId = jobIdIn;
64      }
65  
66      private String jobNm;
67  
68      /**
69       * nom de la tache
70       * @return this.jobNm String
71       */
72      public String getJobNm()
73      {
74          return this.jobNm;
75      }
76  
77      /**
78       * nom de la tache
79       * @param jobNmIn String
80       */
81      public void setJobNm(String jobNmIn)
82      {
83          this.jobNm = jobNmIn;
84      }
85  
86      private String jobStatus;
87  
88      /**
89       * statut de la tache (en cours, terminée, annulée, échouée)
90       * @return this.jobStatus String
91       */
92      public String getJobStatus()
93      {
94          return this.jobStatus;
95      }
96  
97      /**
98       * statut de la tache (en cours, terminée, annulée, échouée)
99       * @param jobStatusIn String
100      */
101     public void setJobStatus(String jobStatusIn)
102     {
103         this.jobStatus = jobStatusIn;
104     }
105 
106     private Date jobStartDt;
107 
108     /**
109      * Date heure minute et seconde de début de la tache
110      * @return this.jobStartDt Date
111      */
112     public Date getJobStartDt()
113     {
114         return this.jobStartDt;
115     }
116 
117     /**
118      * Date heure minute et seconde de début de la tache
119      * @param jobStartDtIn Date
120      */
121     public void setJobStartDt(Date jobStartDtIn)
122     {
123         this.jobStartDt = jobStartDtIn;
124     }
125 
126     private Date jobEndDt;
127 
128     /**
129      * date de la fin de la tache
130      * @return this.jobEndDt Date
131      */
132     public Date getJobEndDt()
133     {
134         return this.jobEndDt;
135     }
136 
137     /**
138      * date de la fin de la tache
139      * @param jobEndDtIn Date
140      */
141     public void setJobEndDt(Date jobEndDtIn)
142     {
143         this.jobEndDt = jobEndDtIn;
144     }
145 
146     private String jobTypeNm;
147 
148     /**
149      * libellé du type de tache
150      * @return this.jobTypeNm String
151      */
152     public String getJobTypeNm()
153     {
154         return this.jobTypeNm;
155     }
156 
157     /**
158      * libellé du type de tache
159      * @param jobTypeNmIn String
160      */
161     public void setJobTypeNm(String jobTypeNmIn)
162     {
163         this.jobTypeNm = jobTypeNmIn;
164     }
165 
166     private String jobLog;
167 
168     /**
169      * Journal d'exécution de la tache
170      * @return this.jobLog String
171      */
172     public String getJobLog()
173     {
174         return this.jobLog;
175     }
176 
177     /**
178      * Journal d'exécution de la tache
179      * @param jobLogIn String
180      */
181     public void setJobLog(String jobLogIn)
182     {
183         this.jobLog = jobLogIn;
184     }
185 
186     private Timestamp updateDt;
187 
188     /**
189      * Date de modification de l'objet, mise à jour par le système
190      * @return this.updateDt Timestamp
191      */
192     public Timestamp getUpdateDt()
193     {
194         return this.updateDt;
195     }
196 
197     /**
198      * Date de modification de l'objet, mise à jour par le système
199      * @param updateDtIn Timestamp
200      */
201     public void setUpdateDt(Timestamp updateDtIn)
202     {
203         this.updateDt = updateDtIn;
204     }
205 
206     // Generate 1 associations
207     private Quser quserId;
208 
209     /**
210      * Liste l'ensemble des agents et utilisateurs du système.
211      * @return this.quserId Quser
212      */
213     public Quser getQuserId()
214     {
215         return this.quserId;
216     }
217 
218     /**
219      * Liste l'ensemble des agents et utilisateurs du système.
220      * @param quserIdIn Quser
221      */
222     public void setQuserId(Quser quserIdIn)
223     {
224         this.quserId = quserIdIn;
225     }
226 
227     /**
228      * Returns <code>true</code> if the argument is an Job instance and all identifiers for this entity
229      * equal the identifiers of the argument entity. Returns <code>false</code> otherwise.
230      */
231     @Override
232     public boolean equals(Object object)
233     {
234         if (this == object)
235         {
236             return true;
237         }
238         if (!(object instanceof Job))
239         {
240             return false;
241         }
242         final Job that = (Job)object;
243         if (this.jobId == null || that.getJobId() == null || !this.jobId.equals(that.getJobId()))
244         {
245             return false;
246         }
247         return true;
248     }
249 
250     /**
251      * Returns a hash code based on this entity's identifiers.
252      */
253     @Override
254     public int hashCode()
255     {
256         int hashCode = 0;
257         hashCode = 29 * hashCode + (this.jobId == null ? 0 : this.jobId.hashCode());
258 
259         return hashCode;
260     }
261 
262     /**
263      * Constructs new instances of {@link Job}.
264      */
265     public static final class Factory
266     {
267         /**
268          * Constructs a new instance of {@link Job}.
269          * @return new JobImpl()
270          */
271         public static Job newInstance()
272         {
273             return new JobImpl();
274         }
275 
276         /**
277          * Constructs a new instance of {@link Job}, taking all required and/or
278          * read-only properties as arguments, except for identifiers.
279          * @param jobNm String
280          * @param jobStatus String
281          * @param jobStartDt Date
282          * @param jobTypeNm String
283          * @return newInstance
284          */
285         public static Job newInstance(String jobNm, String jobStatus, Date jobStartDt, String jobTypeNm)
286         {
287             final Job entity = new JobImpl();
288             entity.setJobNm(jobNm);
289             entity.setJobStatus(jobStatus);
290             entity.setJobStartDt(jobStartDt);
291             entity.setJobTypeNm(jobTypeNm);
292             return entity;
293         }
294 
295         /**
296          * Constructs a new instance of {@link Job}, taking all possible properties
297          * (except the identifier(s))as arguments.
298          * @param jobNm String
299          * @param jobStatus String
300          * @param jobStartDt Date
301          * @param jobEndDt Date
302          * @param jobTypeNm String
303          * @param jobLog String
304          * @param updateDt Timestamp
305          * @param quserId Quser
306          * @return newInstance Job
307          */
308         public static Job newInstance(String jobNm, String jobStatus, Date jobStartDt, Date jobEndDt, String jobTypeNm, String jobLog, Timestamp updateDt, Quser quserId)
309         {
310             final Job entity = new JobImpl();
311             entity.setJobNm(jobNm);
312             entity.setJobStatus(jobStatus);
313             entity.setJobStartDt(jobStartDt);
314             entity.setJobEndDt(jobEndDt);
315             entity.setJobTypeNm(jobTypeNm);
316             entity.setJobLog(jobLog);
317             entity.setUpdateDt(updateDt);
318             entity.setQuserId(quserId);
319             return entity;
320         }
321     }
322 
323     /**
324      * @see Comparable#compareTo
325      */
326     public int compareTo(Job o)
327     {
328         int cmp = 0;
329         if (this.getJobId() != null)
330         {
331             cmp = this.getJobId().compareTo(o.getJobId());
332         }
333         else
334         {
335             if (this.getJobNm() != null)
336             {
337                 cmp = (cmp != 0 ? cmp : this.getJobNm().compareTo(o.getJobNm()));
338             }
339             if (this.getJobStatus() != null)
340             {
341                 cmp = (cmp != 0 ? cmp : this.getJobStatus().compareTo(o.getJobStatus()));
342             }
343             if (this.getJobStartDt() != null)
344             {
345                 cmp = (cmp != 0 ? cmp : this.getJobStartDt().compareTo(o.getJobStartDt()));
346             }
347             if (this.getJobEndDt() != null)
348             {
349                 cmp = (cmp != 0 ? cmp : this.getJobEndDt().compareTo(o.getJobEndDt()));
350             }
351             if (this.getJobTypeNm() != null)
352             {
353                 cmp = (cmp != 0 ? cmp : this.getJobTypeNm().compareTo(o.getJobTypeNm()));
354             }
355             if (this.getJobLog() != null)
356             {
357                 cmp = (cmp != 0 ? cmp : this.getJobLog().compareTo(o.getJobLog()));
358             }
359             if (this.getUpdateDt() != null)
360             {
361                 cmp = (cmp != 0 ? cmp : this.getUpdateDt().compareTo(o.getUpdateDt()));
362             }
363         }
364         return cmp;
365     }
366 // HibernateEntity.vsl merge-point
367 // Job.java merge-point
368 }