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.rule;
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.referential.pmfm.Fraction;
30  import fr.ifremer.quadrige2.core.dao.referential.pmfm.Matrix;
31  import fr.ifremer.quadrige2.core.dao.referential.pmfm.Method;
32  import fr.ifremer.quadrige2.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 5 associations
90      private Matrix matrix;
91  
92      /**
93       * Support utilisé pour mesurer un paramètre.
94       * @return this.matrix Matrix
95       */
96      public Matrix getMatrix()
97      {
98          return this.matrix;
99      }
100 
101     /**
102      * Support utilisé pour mesurer un paramètre.
103      * @param matrixIn Matrix
104      */
105     public void setMatrix(Matrix matrixIn)
106     {
107         this.matrix = matrixIn;
108     }
109 
110     private Method method;
111 
112     /**
113      * Méthode utilisée pour mesurer un paramètre.
114      * @return this.method Method
115      */
116     public Method getMethod()
117     {
118         return this.method;
119     }
120 
121     /**
122      * Méthode utilisée pour mesurer un paramètre.
123      * @param methodIn Method
124      */
125     public void setMethod(Method methodIn)
126     {
127         this.method = methodIn;
128     }
129 
130     private Parameter parameter;
131 
132     /**
133      * Liste les différents paramètres mesurés. Attention, voir PARAMETRE SISMER.
134      * @return this.parameter Parameter
135      */
136     public Parameter getParameter()
137     {
138         return this.parameter;
139     }
140 
141     /**
142      * Liste les différents paramètres mesurés. Attention, voir PARAMETRE SISMER.
143      * @param parameterIn Parameter
144      */
145     public void setParameter(Parameter parameterIn)
146     {
147         this.parameter = parameterIn;
148     }
149 
150     private Fraction fraction;
151 
152     /**
153      * Liste les fractions (compléter la description).
154      * @return this.fraction Fraction
155      */
156     public Fraction getFraction()
157     {
158         return this.fraction;
159     }
160 
161     /**
162      * Liste les fractions (compléter la description).
163      * @param fractionIn Fraction
164      */
165     public void setFraction(Fraction fractionIn)
166     {
167         this.fraction = fractionIn;
168     }
169 
170     private Rule rule;
171 
172     /**
173      * Cette table permet de conserver les règles de contrôle
174      * @return this.rule Rule
175      */
176     public Rule getRule()
177     {
178         return this.rule;
179     }
180 
181     /**
182      * Cette table permet de conserver les règles de contrôle
183      * @param ruleIn Rule
184      */
185     public void setRule(Rule ruleIn)
186     {
187         this.rule = ruleIn;
188     }
189 
190     /**
191      * Returns <code>true</code> if the argument is an RulePmfm instance and all identifiers for this entity
192      * equal the identifiers of the argument entity. Returns <code>false</code> otherwise.
193      */
194     @Override
195     public boolean equals(Object object)
196     {
197         if (this == object)
198         {
199             return true;
200         }
201         if (!(object instanceof RulePmfm))
202         {
203             return false;
204         }
205         final RulePmfm that = (RulePmfm)object;
206         if (this.rulePmfmId == null || that.getRulePmfmId() == null || !this.rulePmfmId.equals(that.getRulePmfmId()))
207         {
208             return false;
209         }
210         return true;
211     }
212 
213     /**
214      * Returns a hash code based on this entity's identifiers.
215      */
216     @Override
217     public int hashCode()
218     {
219         int hashCode = 0;
220         hashCode = 29 * hashCode + (this.rulePmfmId == null ? 0 : this.rulePmfmId.hashCode());
221 
222         return hashCode;
223     }
224 
225     /**
226      * Constructs new instances of {@link RulePmfm}.
227      */
228     public static final class Factory
229     {
230         /**
231          * Constructs a new instance of {@link RulePmfm}.
232          * @return new RulePmfmImpl()
233          */
234         public static RulePmfm newInstance()
235         {
236             return new RulePmfmImpl();
237         }
238 
239         /**
240          * Constructs a new instance of {@link RulePmfm}, taking all required and/or
241          * read-only properties as arguments, except for identifiers.
242          * @param updateDt Timestamp
243          * @param parameter Parameter
244          * @param rule Rule
245          * @return newInstance
246          */
247         public static RulePmfm newInstance(Timestamp updateDt, Parameter parameter, Rule rule)
248         {
249             final RulePmfm entity = new RulePmfmImpl();
250             entity.setUpdateDt(updateDt);
251             entity.setParameter(parameter);
252             entity.setRule(rule);
253             return entity;
254         }
255 
256         /**
257          * Constructs a new instance of {@link RulePmfm}, taking all possible properties
258          * (except the identifier(s))as arguments.
259          * @param updateDt Timestamp
260          * @param matrix Matrix
261          * @param method Method
262          * @param parameter Parameter
263          * @param fraction Fraction
264          * @param rule Rule
265          * @return newInstance RulePmfm
266          */
267         public static RulePmfm newInstance(Timestamp updateDt, Matrix matrix, Method method, Parameter parameter, Fraction fraction, Rule rule)
268         {
269             final RulePmfm entity = new RulePmfmImpl();
270             entity.setUpdateDt(updateDt);
271             entity.setMatrix(matrix);
272             entity.setMethod(method);
273             entity.setParameter(parameter);
274             entity.setFraction(fraction);
275             entity.setRule(rule);
276             return entity;
277         }
278     }
279 
280     /**
281      * @see Comparable#compareTo
282      */
283     public int compareTo(RulePmfm o)
284     {
285         int cmp = 0;
286         if (this.getRulePmfmId() != null)
287         {
288             cmp = this.getRulePmfmId().compareTo(o.getRulePmfmId());
289         }
290         else
291         {
292             if (this.getUpdateDt() != null)
293             {
294                 cmp = (cmp != 0 ? cmp : this.getUpdateDt().compareTo(o.getUpdateDt()));
295             }
296         }
297         return cmp;
298     }
299 // HibernateEntity.vsl merge-point
300 // RulePmfm.java merge-point
301 }