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