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.rule;
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.referential.Unit;
29  import fr.ifremer.quadrige3.core.dao.referential.pmfm.Fraction;
30  import fr.ifremer.quadrige3.core.dao.referential.pmfm.Matrix;
31  import fr.ifremer.quadrige3.core.dao.referential.pmfm.Method;
32  import fr.ifremer.quadrige3.core.dao.referential.pmfm.Parameter;
33  import java.io.Serializable;
34  import java.sql.Timestamp;
35  
36  /**
37   * Cette table permet de conserver les PMFM concernés par une règle de contrôle
38   */
39  // HibernateEntity.vsl annotations merge-point
40  public abstract class RulePmfm
41      implements Serializable, Comparable<RulePmfm>
42  {
43      /**
44       * The serial version UID of this class. Needed for serialization.
45       */
46      private static final long serialVersionUID = 568638865095291051L;
47  
48      // Generate 2 attributes
49      private Integer rulePmfmId;
50  
51      /**
52       * Identifiant unique du paramètre_PMFM de la règle de contrôle
53       * @return this.rulePmfmId Integer
54       */
55      public Integer getRulePmfmId()
56      {
57          return this.rulePmfmId;
58      }
59  
60      /**
61       * Identifiant unique du paramètre_PMFM de la règle de contrôle
62       * @param rulePmfmIdIn Integer
63       */
64      public void setRulePmfmId(Integer rulePmfmIdIn)
65      {
66          this.rulePmfmId = rulePmfmIdIn;
67      }
68  
69      private Timestamp updateDt;
70  
71      /**
72       * Date de modification de l'objet, mise à jour par le système
73       * @return this.updateDt Timestamp
74       */
75      public Timestamp getUpdateDt()
76      {
77          return this.updateDt;
78      }
79  
80      /**
81       * Date de modification de l'objet, mise à jour par le système
82       * @param updateDtIn Timestamp
83       */
84      public void setUpdateDt(Timestamp updateDtIn)
85      {
86          this.updateDt = updateDtIn;
87      }
88  
89      // Generate 6 associations
90      private Unit unit;
91  
92      /**
93       * Liste l'ensemble des unités de mesure.
94       * @return this.unit Unit
95       */
96      public Unit getUnit()
97      {
98          return this.unit;
99      }
100 
101     /**
102      * Liste l'ensemble des unités de mesure.
103      * @param unitIn Unit
104      */
105     public void setUnit(Unit unitIn)
106     {
107         this.unit = unitIn;
108     }
109 
110     private Matrix matrix;
111 
112     /**
113      * Support utilisé pour mesurer un paramètre.
114      * @return this.matrix Matrix
115      */
116     public Matrix getMatrix()
117     {
118         return this.matrix;
119     }
120 
121     /**
122      * Support utilisé pour mesurer un paramètre.
123      * @param matrixIn Matrix
124      */
125     public void setMatrix(Matrix matrixIn)
126     {
127         this.matrix = matrixIn;
128     }
129 
130     private Method method;
131 
132     /**
133      * Méthode utilisée pour mesurer un paramètre.
134      * @return this.method Method
135      */
136     public Method getMethod()
137     {
138         return this.method;
139     }
140 
141     /**
142      * Méthode utilisée pour mesurer un paramètre.
143      * @param methodIn Method
144      */
145     public void setMethod(Method methodIn)
146     {
147         this.method = methodIn;
148     }
149 
150     private Parameter parameter;
151 
152     /**
153      * Liste les différents paramètres mesurés. Attention, voir PARAMETRE SISMER.
154      * @return this.parameter Parameter
155      */
156     public Parameter getParameter()
157     {
158         return this.parameter;
159     }
160 
161     /**
162      * Liste les différents paramètres mesurés. Attention, voir PARAMETRE SISMER.
163      * @param parameterIn Parameter
164      */
165     public void setParameter(Parameter parameterIn)
166     {
167         this.parameter = parameterIn;
168     }
169 
170     private Fraction fraction;
171 
172     /**
173      * Liste les fractions (compléter la description).
174      * @return this.fraction Fraction
175      */
176     public Fraction getFraction()
177     {
178         return this.fraction;
179     }
180 
181     /**
182      * Liste les fractions (compléter la description).
183      * @param fractionIn Fraction
184      */
185     public void setFraction(Fraction fractionIn)
186     {
187         this.fraction = fractionIn;
188     }
189 
190     private Rule rule;
191 
192     /**
193      * Cette table permet de conserver les règles de contrôle
194      * @return this.rule Rule
195      */
196     public Rule getRule()
197     {
198         return this.rule;
199     }
200 
201     /**
202      * Cette table permet de conserver les règles de contrôle
203      * @param ruleIn Rule
204      */
205     public void setRule(Rule ruleIn)
206     {
207         this.rule = ruleIn;
208     }
209 
210     /**
211      * Returns <code>true</code> if the argument is an RulePmfm instance and all identifiers for this entity
212      * equal the identifiers of the argument entity. Returns <code>false</code> otherwise.
213      */
214     @Override
215     public boolean equals(Object object)
216     {
217         if (this == object)
218         {
219             return true;
220         }
221         if (!(object instanceof RulePmfm))
222         {
223             return false;
224         }
225         final RulePmfm that = (RulePmfm)object;
226         if (this.rulePmfmId == null || that.getRulePmfmId() == null || !this.rulePmfmId.equals(that.getRulePmfmId()))
227         {
228             return false;
229         }
230         return true;
231     }
232 
233     /**
234      * Returns a hash code based on this entity's identifiers.
235      */
236     @Override
237     public int hashCode()
238     {
239         int hashCode = 0;
240         hashCode = 29 * hashCode + (this.rulePmfmId == null ? 0 : this.rulePmfmId.hashCode());
241 
242         return hashCode;
243     }
244 
245     /**
246      * Constructs new instances of {@link RulePmfm}.
247      */
248     public static final class Factory
249     {
250         /**
251          * Constructs a new instance of {@link RulePmfm}.
252          * @return new RulePmfmImpl()
253          */
254         public static RulePmfm newInstance()
255         {
256             return new RulePmfmImpl();
257         }
258 
259         /**
260          * Constructs a new instance of {@link RulePmfm}, taking all required and/or
261          * read-only properties as arguments, except for identifiers.
262          * @param parameter Parameter
263          * @param rule Rule
264          * @return newInstance
265          */
266         public static RulePmfm newInstance(Parameter parameter, Rule rule)
267         {
268             final RulePmfm entity = new RulePmfmImpl();
269             entity.setParameter(parameter);
270             entity.setRule(rule);
271             return entity;
272         }
273 
274         /**
275          * Constructs a new instance of {@link RulePmfm}, taking all possible properties
276          * (except the identifier(s))as arguments.
277          * @param updateDt Timestamp
278          * @param unit Unit
279          * @param matrix Matrix
280          * @param method Method
281          * @param parameter Parameter
282          * @param fraction Fraction
283          * @param rule Rule
284          * @return newInstance RulePmfm
285          */
286         public static RulePmfm newInstance(Timestamp updateDt, Unit unit, Matrix matrix, Method method, Parameter parameter, Fraction fraction, Rule rule)
287         {
288             final RulePmfm entity = new RulePmfmImpl();
289             entity.setUpdateDt(updateDt);
290             entity.setUnit(unit);
291             entity.setMatrix(matrix);
292             entity.setMethod(method);
293             entity.setParameter(parameter);
294             entity.setFraction(fraction);
295             entity.setRule(rule);
296             return entity;
297         }
298     }
299 
300     /**
301      * @see Comparable#compareTo
302      */
303     public int compareTo(RulePmfm o)
304     {
305         int cmp = 0;
306         if (this.getRulePmfmId() != null)
307         {
308             cmp = this.getRulePmfmId().compareTo(o.getRulePmfmId());
309         }
310         else
311         {
312             if (this.getUpdateDt() != null)
313             {
314                 cmp = (cmp != 0 ? cmp : this.getUpdateDt().compareTo(o.getUpdateDt()));
315             }
316         }
317         return cmp;
318     }
319 // HibernateEntity.vsl merge-point
320 // RulePmfm.java merge-point
321 }