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.extraction;
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  import java.util.Date;
32  
33  /**
34   * Ensemble des périodes saisies par l'utilisateur pour une extraction
35   */
36  // HibernateEntity.vsl annotations merge-point
37  public abstract class ExtractSurveyPeriod
38      implements Serializable, Comparable<ExtractSurveyPeriod>
39  {
40      /**
41       * The serial version UID of this class. Needed for serialization.
42       */
43      private static final long serialVersionUID = -7438515481671501123L;
44  
45      // Generate 4 attributes
46      private Integer extractSurveyPeriodId;
47  
48      /**
49       * identifiant interne de la période saisie pour le filtre d'extraction
50       * @return this.extractSurveyPeriodId Integer
51       */
52      public Integer getExtractSurveyPeriodId()
53      {
54          return this.extractSurveyPeriodId;
55      }
56  
57      /**
58       * identifiant interne de la période saisie pour le filtre d'extraction
59       * @param extractSurveyPeriodIdIn Integer
60       */
61      public void setExtractSurveyPeriodId(Integer extractSurveyPeriodIdIn)
62      {
63          this.extractSurveyPeriodId = extractSurveyPeriodIdIn;
64      }
65  
66      private Date extractSurveyPeriodStartDt;
67  
68      /**
69       * début de la période
70       * @return this.extractSurveyPeriodStartDt Date
71       */
72      public Date getExtractSurveyPeriodStartDt()
73      {
74          return this.extractSurveyPeriodStartDt;
75      }
76  
77      /**
78       * début de la période
79       * @param extractSurveyPeriodStartDtIn Date
80       */
81      public void setExtractSurveyPeriodStartDt(Date extractSurveyPeriodStartDtIn)
82      {
83          this.extractSurveyPeriodStartDt = extractSurveyPeriodStartDtIn;
84      }
85  
86      private Date extractSurveyPeriodEndDt;
87  
88      /**
89       * fin de la période
90       * @return this.extractSurveyPeriodEndDt Date
91       */
92      public Date getExtractSurveyPeriodEndDt()
93      {
94          return this.extractSurveyPeriodEndDt;
95      }
96  
97      /**
98       * fin de la période
99       * @param extractSurveyPeriodEndDtIn Date
100      */
101     public void setExtractSurveyPeriodEndDt(Date extractSurveyPeriodEndDtIn)
102     {
103         this.extractSurveyPeriodEndDt = extractSurveyPeriodEndDtIn;
104     }
105 
106     private Timestamp updateDt;
107 
108     /**
109      * Date de modification de l'objet, mise à jour par le système
110      * @return this.updateDt Timestamp
111      */
112     public Timestamp getUpdateDt()
113     {
114         return this.updateDt;
115     }
116 
117     /**
118      * Date de modification de l'objet, mise à jour par le système
119      * @param updateDtIn Timestamp
120      */
121     public void setUpdateDt(Timestamp updateDtIn)
122     {
123         this.updateDt = updateDtIn;
124     }
125 
126     // Generate 1 associations
127     private ExtractFilter extractFilter;
128 
129     /**
130      * Définit les éléments supplémentaires au filtre et nécessaires à l'extraction.
131      * @return this.extractFilter ExtractFilter
132      */
133     public ExtractFilter getExtractFilter()
134     {
135         return this.extractFilter;
136     }
137 
138     /**
139      * Définit les éléments supplémentaires au filtre et nécessaires à l'extraction.
140      * @param extractFilterIn ExtractFilter
141      */
142     public void setExtractFilter(ExtractFilter extractFilterIn)
143     {
144         this.extractFilter = extractFilterIn;
145     }
146 
147     /**
148      * Returns <code>true</code> if the argument is an ExtractSurveyPeriod instance and all identifiers for this entity
149      * equal the identifiers of the argument entity. Returns <code>false</code> otherwise.
150      */
151     @Override
152     public boolean equals(Object object)
153     {
154         if (this == object)
155         {
156             return true;
157         }
158         if (!(object instanceof ExtractSurveyPeriod))
159         {
160             return false;
161         }
162         final ExtractSurveyPeriod that = (ExtractSurveyPeriod)object;
163         if (this.extractSurveyPeriodId == null || that.getExtractSurveyPeriodId() == null || !this.extractSurveyPeriodId.equals(that.getExtractSurveyPeriodId()))
164         {
165             return false;
166         }
167         return true;
168     }
169 
170     /**
171      * Returns a hash code based on this entity's identifiers.
172      */
173     @Override
174     public int hashCode()
175     {
176         int hashCode = 0;
177         hashCode = 29 * hashCode + (this.extractSurveyPeriodId == null ? 0 : this.extractSurveyPeriodId.hashCode());
178 
179         return hashCode;
180     }
181 
182     /**
183      * Constructs new instances of {@link ExtractSurveyPeriod}.
184      */
185     public static final class Factory
186     {
187         /**
188          * Constructs a new instance of {@link ExtractSurveyPeriod}.
189          * @return new ExtractSurveyPeriodImpl()
190          */
191         public static ExtractSurveyPeriod newInstance()
192         {
193             return new ExtractSurveyPeriodImpl();
194         }
195 
196 
197         /**
198          * Constructs a new instance of {@link ExtractSurveyPeriod}, taking all possible properties
199          * (except the identifier(s))as arguments.
200          * @param extractSurveyPeriodStartDt Date
201          * @param extractSurveyPeriodEndDt Date
202          * @param updateDt Timestamp
203          * @param extractFilter ExtractFilter
204          * @return newInstance ExtractSurveyPeriod
205          */
206         public static ExtractSurveyPeriod newInstance(Date extractSurveyPeriodStartDt, Date extractSurveyPeriodEndDt, Timestamp updateDt, ExtractFilter extractFilter)
207         {
208             final ExtractSurveyPeriod entity = new ExtractSurveyPeriodImpl();
209             entity.setExtractSurveyPeriodStartDt(extractSurveyPeriodStartDt);
210             entity.setExtractSurveyPeriodEndDt(extractSurveyPeriodEndDt);
211             entity.setUpdateDt(updateDt);
212             entity.setExtractFilter(extractFilter);
213             return entity;
214         }
215     }
216 
217     /**
218      * @see Comparable#compareTo
219      */
220     public int compareTo(ExtractSurveyPeriod o)
221     {
222         int cmp = 0;
223         if (this.getExtractSurveyPeriodId() != null)
224         {
225             cmp = this.getExtractSurveyPeriodId().compareTo(o.getExtractSurveyPeriodId());
226         }
227         else
228         {
229             if (this.getExtractSurveyPeriodStartDt() != null)
230             {
231                 cmp = (cmp != 0 ? cmp : this.getExtractSurveyPeriodStartDt().compareTo(o.getExtractSurveyPeriodStartDt()));
232             }
233             if (this.getExtractSurveyPeriodEndDt() != null)
234             {
235                 cmp = (cmp != 0 ? cmp : this.getExtractSurveyPeriodEndDt().compareTo(o.getExtractSurveyPeriodEndDt()));
236             }
237             if (this.getUpdateDt() != null)
238             {
239                 cmp = (cmp != 0 ? cmp : this.getUpdateDt().compareTo(o.getUpdateDt()));
240             }
241         }
242         return cmp;
243     }
244 // HibernateEntity.vsl merge-point
245 // ExtractSurveyPeriod.java merge-point
246 }