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 java.io.Serializable;
29  import java.sql.Timestamp;
30  
31  /**
32   * Cette table permet de conserver les paramètres des règles de contrôle
33   */
34  // HibernateEntity.vsl annotations merge-point
35  public abstract class RuleParameter
36      implements Serializable, Comparable<RuleParameter>
37  {
38      /**
39       * The serial version UID of this class. Needed for serialization.
40       */
41      private static final long serialVersionUID = -329413034752799987L;
42  
43      // Generate 3 attributes
44      private Integer ruleParId;
45  
46      /**
47       * Identifiant unique du paramètre de la règle
48       * @return this.ruleParId Integer
49       */
50      public Integer getRuleParId()
51      {
52          return this.ruleParId;
53      }
54  
55      /**
56       * Identifiant unique du paramètre de la règle
57       * @param ruleParIdIn Integer
58       */
59      public void setRuleParId(Integer ruleParIdIn)
60      {
61          this.ruleParId = ruleParIdIn;
62      }
63  
64      private String ruleParValue;
65  
66      /**
67       * Valeur du paramètre de la fonction
68       * @return this.ruleParValue String
69       */
70      public String getRuleParValue()
71      {
72          return this.ruleParValue;
73      }
74  
75      /**
76       * Valeur du paramètre de la fonction
77       * @param ruleParValueIn String
78       */
79      public void setRuleParValue(String ruleParValueIn)
80      {
81          this.ruleParValue = ruleParValueIn;
82      }
83  
84      private Timestamp updateDt;
85  
86      /**
87       * Date de modification de l'objet, mise à jour par le système
88       * @return this.updateDt Timestamp
89       */
90      public Timestamp getUpdateDt()
91      {
92          return this.updateDt;
93      }
94  
95      /**
96       * Date de modification de l'objet, mise à jour par le système
97       * @param updateDtIn Timestamp
98       */
99      public void setUpdateDt(Timestamp updateDtIn)
100     {
101         this.updateDt = updateDtIn;
102     }
103 
104     // Generate 2 associations
105     private FunctionParameter functionParameter;
106 
107     /**
108      * Cette table permet de conserver les paramètres des fonctions de contrôle
109      * @return this.functionParameter FunctionParameter
110      */
111     public FunctionParameter getFunctionParameter()
112     {
113         return this.functionParameter;
114     }
115 
116     /**
117      * Cette table permet de conserver les paramètres des fonctions de contrôle
118      * @param functionParameterIn FunctionParameter
119      */
120     public void setFunctionParameter(FunctionParameter functionParameterIn)
121     {
122         this.functionParameter = functionParameterIn;
123     }
124 
125     private Rule rule;
126 
127     /**
128      * Cette table permet de conserver les règles de contrôle
129      * @return this.rule Rule
130      */
131     public Rule getRule()
132     {
133         return this.rule;
134     }
135 
136     /**
137      * Cette table permet de conserver les règles de contrôle
138      * @param ruleIn Rule
139      */
140     public void setRule(Rule ruleIn)
141     {
142         this.rule = ruleIn;
143     }
144 
145     /**
146      * Returns <code>true</code> if the argument is an RuleParameter instance and all identifiers for this entity
147      * equal the identifiers of the argument entity. Returns <code>false</code> otherwise.
148      */
149     @Override
150     public boolean equals(Object object)
151     {
152         if (this == object)
153         {
154             return true;
155         }
156         if (!(object instanceof RuleParameter))
157         {
158             return false;
159         }
160         final RuleParameter that = (RuleParameter)object;
161         if (this.ruleParId == null || that.getRuleParId() == null || !this.ruleParId.equals(that.getRuleParId()))
162         {
163             return false;
164         }
165         return true;
166     }
167 
168     /**
169      * Returns a hash code based on this entity's identifiers.
170      */
171     @Override
172     public int hashCode()
173     {
174         int hashCode = 0;
175         hashCode = 29 * hashCode + (this.ruleParId == null ? 0 : this.ruleParId.hashCode());
176 
177         return hashCode;
178     }
179 
180     /**
181      * Constructs new instances of {@link RuleParameter}.
182      */
183     public static final class Factory
184     {
185         /**
186          * Constructs a new instance of {@link RuleParameter}.
187          * @return new RuleParameterImpl()
188          */
189         public static RuleParameter newInstance()
190         {
191             return new RuleParameterImpl();
192         }
193 
194         /**
195          * Constructs a new instance of {@link RuleParameter}, taking all required and/or
196          * read-only properties as arguments, except for identifiers.
197          * @param ruleParValue String
198          * @param functionParameter FunctionParameter
199          * @param rule Rule
200          * @return newInstance
201          */
202         public static RuleParameter newInstance(String ruleParValue, FunctionParameter functionParameter, Rule rule)
203         {
204             final RuleParameter entity = new RuleParameterImpl();
205             entity.setRuleParValue(ruleParValue);
206             entity.setFunctionParameter(functionParameter);
207             entity.setRule(rule);
208             return entity;
209         }
210 
211         /**
212          * Constructs a new instance of {@link RuleParameter}, taking all possible properties
213          * (except the identifier(s))as arguments.
214          * @param ruleParValue String
215          * @param updateDt Timestamp
216          * @param functionParameter FunctionParameter
217          * @param rule Rule
218          * @return newInstance RuleParameter
219          */
220         public static RuleParameter newInstance(String ruleParValue, Timestamp updateDt, FunctionParameter functionParameter, Rule rule)
221         {
222             final RuleParameter entity = new RuleParameterImpl();
223             entity.setRuleParValue(ruleParValue);
224             entity.setUpdateDt(updateDt);
225             entity.setFunctionParameter(functionParameter);
226             entity.setRule(rule);
227             return entity;
228         }
229     }
230 
231     /**
232      * @see Comparable#compareTo
233      */
234     public int compareTo(RuleParameter o)
235     {
236         int cmp = 0;
237         if (this.getRuleParId() != null)
238         {
239             cmp = this.getRuleParId().compareTo(o.getRuleParId());
240         }
241         else
242         {
243             if (this.getRuleParValue() != null)
244             {
245                 cmp = (cmp != 0 ? cmp : this.getRuleParValue().compareTo(o.getRuleParValue()));
246             }
247             if (this.getUpdateDt() != null)
248             {
249                 cmp = (cmp != 0 ? cmp : this.getUpdateDt().compareTo(o.getUpdateDt()));
250             }
251         }
252         return cmp;
253     }
254 // HibernateEntity.vsl merge-point
255 // RuleParameter.java merge-point
256 }