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