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 RuleGroup
36 implements Serializable, Comparable<RuleGroup>
37 {
38 /**
39 * The serial version UID of this class. Needed for serialization.
40 */
41 private static final long serialVersionUID = -5784684343233426517L;
42
43 // Generate 5 attributes
44 private Integer ruleGroupId;
45
46 /**
47 *
48 * @return this.ruleGroupId Integer
49 */
50 public Integer getRuleGroupId()
51 {
52 return this.ruleGroupId;
53 }
54
55 /**
56 *
57 * @param ruleGroupIdIn Integer
58 */
59 public void setRuleGroupId(Integer ruleGroupIdIn)
60 {
61 this.ruleGroupId = ruleGroupIdIn;
62 }
63
64 private String ruleGroupLb;
65
66 /**
67 *
68 * @return this.ruleGroupLb String
69 */
70 public String getRuleGroupLb()
71 {
72 return this.ruleGroupLb;
73 }
74
75 /**
76 *
77 * @param ruleGroupLbIn String
78 */
79 public void setRuleGroupLb(String ruleGroupLbIn)
80 {
81 this.ruleGroupLb = ruleGroupLbIn;
82 }
83
84 private String ruleGroupIsActive;
85
86 /**
87 *
88 * @return this.ruleGroupIsActive String
89 */
90 public String getRuleGroupIsActive()
91 {
92 return this.ruleGroupIsActive;
93 }
94
95 /**
96 *
97 * @param ruleGroupIsActiveIn String
98 */
99 public void setRuleGroupIsActive(String ruleGroupIsActiveIn)
100 {
101 this.ruleGroupIsActive = ruleGroupIsActiveIn;
102 }
103
104 private String ruleGroupIsOr;
105
106 /**
107 *
108 * @return this.ruleGroupIsOr String
109 */
110 public String getRuleGroupIsOr()
111 {
112 return this.ruleGroupIsOr;
113 }
114
115 /**
116 *
117 * @param ruleGroupIsOrIn String
118 */
119 public void setRuleGroupIsOr(String ruleGroupIsOrIn)
120 {
121 this.ruleGroupIsOr = ruleGroupIsOrIn;
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 1 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 /**
166 * Returns <code>true</code> if the argument is an RuleGroup instance and all identifiers for this entity
167 * equal the identifiers of the argument entity. Returns <code>false</code> otherwise.
168 */
169 @Override
170 public boolean equals(Object object)
171 {
172 if (this == object)
173 {
174 return true;
175 }
176 if (!(object instanceof RuleGroup))
177 {
178 return false;
179 }
180 final RuleGroup that = (RuleGroup)object;
181 if (this.ruleGroupId == null || that.getRuleGroupId() == null || !this.ruleGroupId.equals(that.getRuleGroupId()))
182 {
183 return false;
184 }
185 return true;
186 }
187
188 /**
189 * Returns a hash code based on this entity's identifiers.
190 */
191 @Override
192 public int hashCode()
193 {
194 int hashCode = 0;
195 hashCode = 29 * hashCode + (this.ruleGroupId == null ? 0 : this.ruleGroupId.hashCode());
196
197 return hashCode;
198 }
199
200 /**
201 * Constructs new instances of {@link RuleGroup}.
202 */
203 public static final class Factory
204 {
205 /**
206 * Constructs a new instance of {@link RuleGroup}.
207 * @return new RuleGroupImpl()
208 */
209 public static RuleGroup newInstance()
210 {
211 return new RuleGroupImpl();
212 }
213
214 /**
215 * Constructs a new instance of {@link RuleGroup}, taking all required and/or
216 * read-only properties as arguments, except for identifiers.
217 * @param ruleGroupLb String
218 * @param ruleGroupIsActive String
219 * @param ruleGroupIsOr String
220 * @param rule Rule
221 * @return newInstance
222 */
223 public static RuleGroup newInstance(String ruleGroupLb, String ruleGroupIsActive, String ruleGroupIsOr, Rule rule)
224 {
225 final RuleGroup entity = new RuleGroupImpl();
226 entity.setRuleGroupLb(ruleGroupLb);
227 entity.setRuleGroupIsActive(ruleGroupIsActive);
228 entity.setRuleGroupIsOr(ruleGroupIsOr);
229 entity.setRule(rule);
230 return entity;
231 }
232
233 /**
234 * Constructs a new instance of {@link RuleGroup}, taking all possible properties
235 * (except the identifier(s))as arguments.
236 * @param ruleGroupLb String
237 * @param ruleGroupIsActive String
238 * @param ruleGroupIsOr String
239 * @param updateDt Timestamp
240 * @param rule Rule
241 * @return newInstance RuleGroup
242 */
243 public static RuleGroup newInstance(String ruleGroupLb, String ruleGroupIsActive, String ruleGroupIsOr, Timestamp updateDt, Rule rule)
244 {
245 final RuleGroup entity = new RuleGroupImpl();
246 entity.setRuleGroupLb(ruleGroupLb);
247 entity.setRuleGroupIsActive(ruleGroupIsActive);
248 entity.setRuleGroupIsOr(ruleGroupIsOr);
249 entity.setUpdateDt(updateDt);
250 entity.setRule(rule);
251 return entity;
252 }
253 }
254
255 /**
256 * @see Comparable#compareTo
257 */
258 public int compareTo(RuleGroup o)
259 {
260 int cmp = 0;
261 if (this.getRuleGroupId() != null)
262 {
263 cmp = this.getRuleGroupId().compareTo(o.getRuleGroupId());
264 }
265 else
266 {
267 if (this.getRuleGroupLb() != null)
268 {
269 cmp = (cmp != 0 ? cmp : this.getRuleGroupLb().compareTo(o.getRuleGroupLb()));
270 }
271 if (this.getRuleGroupIsActive() != null)
272 {
273 cmp = (cmp != 0 ? cmp : this.getRuleGroupIsActive().compareTo(o.getRuleGroupIsActive()));
274 }
275 if (this.getRuleGroupIsOr() != null)
276 {
277 cmp = (cmp != 0 ? cmp : this.getRuleGroupIsOr().compareTo(o.getRuleGroupIsOr()));
278 }
279 if (this.getUpdateDt() != null)
280 {
281 cmp = (cmp != 0 ? cmp : this.getUpdateDt().compareTo(o.getUpdateDt()));
282 }
283 }
284 return cmp;
285 }
286 // HibernateEntity.vsl merge-point
287 // RuleGroup.java merge-point
288 }