1
2
3
4
5
6
7
8
9 package com.hack23.cia.model.internal.application.system.impl;
10
11 import java.io.Serializable;
12 import java.util.ArrayList;
13 import java.util.Collection;
14 import java.util.List;
15 import javax.persistence.Basic;
16 import javax.persistence.CascadeType;
17 import javax.persistence.Column;
18 import javax.persistence.Entity;
19 import javax.persistence.GeneratedValue;
20 import javax.persistence.GenerationType;
21 import javax.persistence.Id;
22 import javax.persistence.Inheritance;
23 import javax.persistence.InheritanceType;
24 import javax.persistence.JoinColumn;
25 import javax.persistence.OneToMany;
26 import javax.persistence.Table;
27 import javax.xml.bind.annotation.XmlAccessType;
28 import javax.xml.bind.annotation.XmlAccessorType;
29 import javax.xml.bind.annotation.XmlAttribute;
30 import javax.xml.bind.annotation.XmlElement;
31 import javax.xml.bind.annotation.XmlType;
32 import com.hack23.cia.model.common.api.ModelObject;
33 import org.jvnet.jaxb2_commons.lang.Equals;
34 import org.jvnet.jaxb2_commons.lang.EqualsStrategy;
35 import org.jvnet.jaxb2_commons.lang.HashCode;
36 import org.jvnet.jaxb2_commons.lang.HashCodeStrategy;
37 import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy;
38 import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy;
39 import org.jvnet.jaxb2_commons.lang.JAXBToStringStrategy;
40 import org.jvnet.jaxb2_commons.lang.ToString;
41 import org.jvnet.jaxb2_commons.lang.ToStringStrategy;
42 import org.jvnet.jaxb2_commons.locator.ObjectLocator;
43 import org.jvnet.jaxb2_commons.locator.util.LocatorUtils;
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69 @XmlAccessorType(XmlAccessType.FIELD)
70 @XmlType(name = "Agency", propOrder = {
71 "modelObjectId",
72 "modelObjectVersion",
73 "agencyName",
74 "description",
75 "portals"
76 })
77 @Entity(name = "Agency")
78 @Table(name = "AGENCY")
79 @Inheritance(strategy = InheritanceType.JOINED)
80 public class Agency
81 implements Serializable, ModelObject, Equals, HashCode, ToString
82 {
83
84 private final static long serialVersionUID = 1L;
85 protected Integer modelObjectId;
86 protected Integer modelObjectVersion;
87 protected String agencyName;
88 protected String description;
89 @XmlElement(nillable = true)
90 protected List<Portal> portals;
91 @XmlAttribute(name = "Hjid")
92 protected Long hjid;
93
94
95
96
97
98
99
100
101
102 @Basic
103 @Column(name = "MODEL_OBJECT_ID", precision = 10, scale = 0)
104 public Integer getModelObjectId() {
105 return modelObjectId;
106 }
107
108
109
110
111
112
113
114
115
116 public void setModelObjectId(Integer value) {
117 this.modelObjectId = value;
118 }
119
120
121
122
123
124
125
126
127
128 @Basic
129 @Column(name = "MODEL_OBJECT_VERSION", precision = 10, scale = 0)
130 public Integer getModelObjectVersion() {
131 return modelObjectVersion;
132 }
133
134
135
136
137
138
139
140
141
142 public void setModelObjectVersion(Integer value) {
143 this.modelObjectVersion = value;
144 }
145
146
147
148
149
150
151
152
153
154 @Basic
155 @Column(name = "AGENCY_NAME", length = 255)
156 public String getAgencyName() {
157 return agencyName;
158 }
159
160
161
162
163
164
165
166
167
168 public void setAgencyName(String value) {
169 this.agencyName = value;
170 }
171
172
173
174
175
176
177
178
179
180 @Basic
181 @Column(name = "DESCRIPTION", length = 255)
182 public String getDescription() {
183 return description;
184 }
185
186
187
188
189
190
191
192
193
194 public void setDescription(String value) {
195 this.description = value;
196 }
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220 @OneToMany(targetEntity = Portal.class, cascade = {
221 CascadeType.ALL
222 })
223 @JoinColumn(name = "PORTALS_AGENCY_HJID")
224 public List<Portal> getPortals() {
225 if (portals == null) {
226 portals = new ArrayList<Portal>();
227 }
228 return this.portals;
229 }
230
231
232
233
234
235 public void setPortals(List<Portal> portals) {
236 this.portals = portals;
237 }
238
239 public Agency withModelObjectId(Integer value) {
240 setModelObjectId(value);
241 return this;
242 }
243
244 public Agency withModelObjectVersion(Integer value) {
245 setModelObjectVersion(value);
246 return this;
247 }
248
249 public Agency withAgencyName(String value) {
250 setAgencyName(value);
251 return this;
252 }
253
254 public Agency withDescription(String value) {
255 setDescription(value);
256 return this;
257 }
258
259 public Agency withPortals(Portal... values) {
260 if (values!= null) {
261 for (Portal value: values) {
262 getPortals().add(value);
263 }
264 }
265 return this;
266 }
267
268 public Agency withPortals(Collection<Portal> values) {
269 if (values!= null) {
270 getPortals().addAll(values);
271 }
272 return this;
273 }
274
275 public Agency withPortals(List<Portal> portals) {
276 setPortals(portals);
277 return this;
278 }
279
280 public String toString() {
281 final ToStringStrategy strategy = JAXBToStringStrategy.INSTANCE;
282 final StringBuilder buffer = new StringBuilder();
283 append(null, buffer, strategy);
284 return buffer.toString();
285 }
286
287 public StringBuilder append(ObjectLocator locator, StringBuilder buffer, ToStringStrategy strategy) {
288 strategy.appendStart(locator, this, buffer);
289 appendFields(locator, buffer, strategy);
290 strategy.appendEnd(locator, this, buffer);
291 return buffer;
292 }
293
294 public StringBuilder appendFields(ObjectLocator locator, StringBuilder buffer, ToStringStrategy strategy) {
295 {
296 Integer theModelObjectId;
297 theModelObjectId = this.getModelObjectId();
298 strategy.appendField(locator, this, "modelObjectId", buffer, theModelObjectId);
299 }
300 {
301 Integer theModelObjectVersion;
302 theModelObjectVersion = this.getModelObjectVersion();
303 strategy.appendField(locator, this, "modelObjectVersion", buffer, theModelObjectVersion);
304 }
305 {
306 String theAgencyName;
307 theAgencyName = this.getAgencyName();
308 strategy.appendField(locator, this, "agencyName", buffer, theAgencyName);
309 }
310 {
311 String theDescription;
312 theDescription = this.getDescription();
313 strategy.appendField(locator, this, "description", buffer, theDescription);
314 }
315 {
316 List<Portal> thePortals;
317 thePortals = (((this.portals!= null)&&(!this.portals.isEmpty()))?this.getPortals():null);
318 strategy.appendField(locator, this, "portals", buffer, thePortals);
319 }
320 return buffer;
321 }
322
323
324
325
326
327
328
329
330
331 @Id
332 @Column(name = "HJID")
333 @GeneratedValue(strategy = GenerationType.AUTO)
334 public Long getHjid() {
335 return hjid;
336 }
337
338
339
340
341
342
343
344
345
346 public void setHjid(Long value) {
347 this.hjid = value;
348 }
349
350 public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) {
351 if ((object == null)||(this.getClass()!= object.getClass())) {
352 return false;
353 }
354 if (this == object) {
355 return true;
356 }
357 final Agency that = ((Agency) object);
358 {
359 Integer lhsModelObjectId;
360 lhsModelObjectId = this.getModelObjectId();
361 Integer rhsModelObjectId;
362 rhsModelObjectId = that.getModelObjectId();
363 if (!strategy.equals(LocatorUtils.property(thisLocator, "modelObjectId", lhsModelObjectId), LocatorUtils.property(thatLocator, "modelObjectId", rhsModelObjectId), lhsModelObjectId, rhsModelObjectId)) {
364 return false;
365 }
366 }
367 {
368 Integer lhsModelObjectVersion;
369 lhsModelObjectVersion = this.getModelObjectVersion();
370 Integer rhsModelObjectVersion;
371 rhsModelObjectVersion = that.getModelObjectVersion();
372 if (!strategy.equals(LocatorUtils.property(thisLocator, "modelObjectVersion", lhsModelObjectVersion), LocatorUtils.property(thatLocator, "modelObjectVersion", rhsModelObjectVersion), lhsModelObjectVersion, rhsModelObjectVersion)) {
373 return false;
374 }
375 }
376 {
377 String lhsAgencyName;
378 lhsAgencyName = this.getAgencyName();
379 String rhsAgencyName;
380 rhsAgencyName = that.getAgencyName();
381 if (!strategy.equals(LocatorUtils.property(thisLocator, "agencyName", lhsAgencyName), LocatorUtils.property(thatLocator, "agencyName", rhsAgencyName), lhsAgencyName, rhsAgencyName)) {
382 return false;
383 }
384 }
385 {
386 String lhsDescription;
387 lhsDescription = this.getDescription();
388 String rhsDescription;
389 rhsDescription = that.getDescription();
390 if (!strategy.equals(LocatorUtils.property(thisLocator, "description", lhsDescription), LocatorUtils.property(thatLocator, "description", rhsDescription), lhsDescription, rhsDescription)) {
391 return false;
392 }
393 }
394 {
395 List<Portal> lhsPortals;
396 lhsPortals = (((this.portals!= null)&&(!this.portals.isEmpty()))?this.getPortals():null);
397 List<Portal> rhsPortals;
398 rhsPortals = (((that.portals!= null)&&(!that.portals.isEmpty()))?that.getPortals():null);
399 if (!strategy.equals(LocatorUtils.property(thisLocator, "portals", lhsPortals), LocatorUtils.property(thatLocator, "portals", rhsPortals), lhsPortals, rhsPortals)) {
400 return false;
401 }
402 }
403 return true;
404 }
405
406 public boolean equals(Object object) {
407 final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE;
408 return equals(null, null, object, strategy);
409 }
410
411 public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) {
412 int currentHashCode = 1;
413 {
414 Integer theModelObjectId;
415 theModelObjectId = this.getModelObjectId();
416 currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "modelObjectId", theModelObjectId), currentHashCode, theModelObjectId);
417 }
418 {
419 Integer theModelObjectVersion;
420 theModelObjectVersion = this.getModelObjectVersion();
421 currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "modelObjectVersion", theModelObjectVersion), currentHashCode, theModelObjectVersion);
422 }
423 {
424 String theAgencyName;
425 theAgencyName = this.getAgencyName();
426 currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "agencyName", theAgencyName), currentHashCode, theAgencyName);
427 }
428 {
429 String theDescription;
430 theDescription = this.getDescription();
431 currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "description", theDescription), currentHashCode, theDescription);
432 }
433 {
434 List<Portal> thePortals;
435 thePortals = (((this.portals!= null)&&(!this.portals.isEmpty()))?this.getPortals():null);
436 currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "portals", thePortals), currentHashCode, thePortals);
437 }
438 return currentHashCode;
439 }
440
441 public int hashCode() {
442 final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE;
443 return this.hashCode(null, strategy);
444 }
445
446 }