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