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   * 
34   */
35  // HibernateEntity.vsl annotations merge-point
36  public abstract class RulePrecondition
37      implements Serializable, Comparable<RulePrecondition>
38  {
39      /**
40       * The serial version UID of this class. Needed for serialization.
41       */
42      private static final long serialVersionUID = 4191826550593543559L;
43  
44      // Generate 5 attributes
45      private Integer rulePrecondId;
46  
47      /**
48       * 
49       * @return this.rulePrecondId Integer
50       */
51      public Integer getRulePrecondId()
52      {
53          return this.rulePrecondId;
54      }
55  
56      /**
57       * 
58       * @param rulePrecondIdIn Integer
59       */
60      public void setRulePrecondId(Integer rulePrecondIdIn)
61      {
62          this.rulePrecondId = rulePrecondIdIn;
63      }
64  
65      private String rulePrecondLb;
66  
67      /**
68       * 
69       * @return this.rulePrecondLb String
70       */
71      public String getRulePrecondLb()
72      {
73          return this.rulePrecondLb;
74      }
75  
76      /**
77       * 
78       * @param rulePrecondLbIn String
79       */
80      public void setRulePrecondLb(String rulePrecondLbIn)
81      {
82          this.rulePrecondLb = rulePrecondLbIn;
83      }
84  
85      private String rulePrecondIsBidir;
86  
87      /**
88       * 
89       * @return this.rulePrecondIsBidir String
90       */
91      public String getRulePrecondIsBidir()
92      {
93          return this.rulePrecondIsBidir;
94      }
95  
96      /**
97       * 
98       * @param rulePrecondIsBidirIn String
99       */
100     public void setRulePrecondIsBidir(String rulePrecondIsBidirIn)
101     {
102         this.rulePrecondIsBidir = rulePrecondIsBidirIn;
103     }
104 
105     private String rulePrecondIsActive;
106 
107     /**
108      * 
109      * @return this.rulePrecondIsActive String
110      */
111     public String getRulePrecondIsActive()
112     {
113         return this.rulePrecondIsActive;
114     }
115 
116     /**
117      * 
118      * @param rulePrecondIsActiveIn String
119      */
120     public void setRulePrecondIsActive(String rulePrecondIsActiveIn)
121     {
122         this.rulePrecondIsActive = rulePrecondIsActiveIn;
123     }
124 
125     private Timestamp updateDt;
126 
127     /**
128      * 
129      * @return this.updateDt Timestamp
130      */
131     public Timestamp getUpdateDt()
132     {
133         return this.updateDt;
134     }
135 
136     /**
137      * 
138      * @param updateDtIn Timestamp
139      */
140     public void setUpdateDt(Timestamp updateDtIn)
141     {
142         this.updateDt = updateDtIn;
143     }
144 
145     // Generate 2 associations
146     private Rule rule;
147 
148     /**
149      * Cette table permet de conserver les règles de contrôle
150      * @return this.rule Rule
151      */
152     public Rule getRule()
153     {
154         return this.rule;
155     }
156 
157     /**
158      * Cette table permet de conserver les règles de contrôle
159      * @param ruleIn Rule
160      */
161     public void setRule(Rule ruleIn)
162     {
163         this.rule = ruleIn;
164     }
165 
166     private Rule usedRule;
167 
168     /**
169      * Cette table permet de conserver les règles de contrôle
170      * @return this.usedRule Rule
171      */
172     public Rule getUsedRule()
173     {
174         return this.usedRule;
175     }
176 
177     /**
178      * Cette table permet de conserver les règles de contrôle
179      * @param usedRuleIn Rule
180      */
181     public void setUsedRule(Rule usedRuleIn)
182     {
183         this.usedRule = usedRuleIn;
184     }
185 
186     /**
187      * Returns <code>true</code> if the argument is an RulePrecondition instance and all identifiers for this entity
188      * equal the identifiers of the argument entity. Returns <code>false</code> otherwise.
189      */
190     @Override
191     public boolean equals(Object object)
192     {
193         if (this == object)
194         {
195             return true;
196         }
197         if (!(object instanceof RulePrecondition))
198         {
199             return false;
200         }
201         final RulePrecondition that = (RulePrecondition)object;
202         if (this.rulePrecondId == null || that.getRulePrecondId() == null || !this.rulePrecondId.equals(that.getRulePrecondId()))
203         {
204             return false;
205         }
206         return true;
207     }
208 
209     /**
210      * Returns a hash code based on this entity's identifiers.
211      */
212     @Override
213     public int hashCode()
214     {
215         int hashCode = 0;
216         hashCode = 29 * hashCode + (this.rulePrecondId == null ? 0 : this.rulePrecondId.hashCode());
217 
218         return hashCode;
219     }
220 
221     /**
222      * Constructs new instances of {@link RulePrecondition}.
223      */
224     public static final class Factory
225     {
226         /**
227          * Constructs a new instance of {@link RulePrecondition}.
228          * @return new RulePreconditionImpl()
229          */
230         public static RulePrecondition newInstance()
231         {
232             return new RulePreconditionImpl();
233         }
234 
235 
236         /**
237          * Constructs a new instance of {@link RulePrecondition}, taking all possible properties
238          * (except the identifier(s))as arguments.
239          * @param rulePrecondLb String
240          * @param rulePrecondIsBidir String
241          * @param rulePrecondIsActive String
242          * @param updateDt Timestamp
243          * @param rule Rule
244          * @param usedRule Rule
245          * @return newInstance RulePrecondition
246          */
247         public static RulePrecondition newInstance(String rulePrecondLb, String rulePrecondIsBidir, String rulePrecondIsActive, Timestamp updateDt, Rule rule, Rule usedRule)
248         {
249             final RulePrecondition entity = new RulePreconditionImpl();
250             entity.setRulePrecondLb(rulePrecondLb);
251             entity.setRulePrecondIsBidir(rulePrecondIsBidir);
252             entity.setRulePrecondIsActive(rulePrecondIsActive);
253             entity.setUpdateDt(updateDt);
254             entity.setRule(rule);
255             entity.setUsedRule(usedRule);
256             return entity;
257         }
258     }
259 
260     /**
261      * @see Comparable#compareTo
262      */
263     public int compareTo(RulePrecondition o)
264     {
265         int cmp = 0;
266         if (this.getRulePrecondId() != null)
267         {
268             cmp = this.getRulePrecondId().compareTo(o.getRulePrecondId());
269         }
270         else
271         {
272             if (this.getRulePrecondLb() != null)
273             {
274                 cmp = (cmp != 0 ? cmp : this.getRulePrecondLb().compareTo(o.getRulePrecondLb()));
275             }
276             if (this.getRulePrecondIsBidir() != null)
277             {
278                 cmp = (cmp != 0 ? cmp : this.getRulePrecondIsBidir().compareTo(o.getRulePrecondIsBidir()));
279             }
280             if (this.getRulePrecondIsActive() != null)
281             {
282                 cmp = (cmp != 0 ? cmp : this.getRulePrecondIsActive().compareTo(o.getRulePrecondIsActive()));
283             }
284             if (this.getUpdateDt() != null)
285             {
286                 cmp = (cmp != 0 ? cmp : this.getUpdateDt().compareTo(o.getUpdateDt()));
287             }
288         }
289         return cmp;
290     }
291 // HibernateEntity.vsl merge-point
292 // RulePrecondition.java merge-point
293 }