1
2
3
4
5
6
7
8
9 package com.hack23.cia.model.external.worldbank.indicators.impl;
10
11 import java.io.Serializable;
12 import javax.persistence.AttributeOverride;
13 import javax.persistence.AttributeOverrides;
14 import javax.persistence.Basic;
15 import javax.persistence.CascadeType;
16 import javax.persistence.Column;
17 import javax.persistence.Embedded;
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.ManyToOne;
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96 @XmlAccessorType(XmlAccessType.FIELD)
97 @XmlType(name = "IndicatorElement", propOrder = {
98 "indicatorName",
99 "source",
100 "sourceNote",
101 "sourceOrganization",
102 "topics"
103 })
104 @Entity(name = "IndicatorElement")
105 @Table(name = "INDICATOR_ELEMENT")
106 @Inheritance(strategy = InheritanceType.JOINED)
107 public class IndicatorElement
108 implements Serializable, ModelObject, Equals, HashCode, ToString
109 {
110
111 @XmlElement(name = "name", required = true)
112 protected String indicatorName;
113 @XmlElement(required = true)
114 protected Source source;
115 @XmlElement(required = true)
116 protected String sourceNote;
117 @XmlElement(required = true)
118 protected String sourceOrganization;
119 @XmlElement(required = true)
120 protected Topics topics;
121 @XmlAttribute(name = "id", required = true)
122 protected String id;
123 @XmlAttribute(name = "Hjid")
124 protected Long hjid;
125
126
127
128
129
130
131
132
133
134 @Basic
135 @Column(name = "INDICATOR_NAME", length = 255)
136 public String getIndicatorName() {
137 return indicatorName;
138 }
139
140
141
142
143
144
145
146
147
148 public void setIndicatorName(String value) {
149 this.indicatorName = value;
150 }
151
152
153
154
155
156
157
158
159
160 @Embedded
161 @AttributeOverrides({
162 @AttributeOverride(name = "value", column = @Column(name = "SOURCE_VALUE", length = 255)),
163 @AttributeOverride(name = "id", column = @Column(name = "SOURCE_ID", length = 255))
164 })
165 public Source getSource() {
166 return source;
167 }
168
169
170
171
172
173
174
175
176
177 public void setSource(Source value) {
178 this.source = value;
179 }
180
181
182
183
184
185
186
187
188
189 @Basic
190 @Column(name = "SOURCE_NOTE", length = 65536)
191 public String getSourceNote() {
192 return sourceNote;
193 }
194
195
196
197
198
199
200
201
202
203 public void setSourceNote(String value) {
204 this.sourceNote = value;
205 }
206
207
208
209
210
211
212
213
214
215 @Basic
216 @Column(name = "SOURCE_ORGANIZATION", length = 65536)
217 public String getSourceOrganization() {
218 return sourceOrganization;
219 }
220
221
222
223
224
225
226
227
228
229 public void setSourceOrganization(String value) {
230 this.sourceOrganization = value;
231 }
232
233
234
235
236
237
238
239
240
241 @ManyToOne(targetEntity = Topics.class, cascade = {
242 CascadeType.ALL
243 })
244 @JoinColumn(name = "TOPICS_INDICATOR_ELEMENT_HJID")
245 public Topics getTopics() {
246 return topics;
247 }
248
249
250
251
252
253
254
255
256
257 public void setTopics(Topics value) {
258 this.topics = value;
259 }
260
261
262
263
264
265
266
267
268
269 @Basic
270 @Column(name = "ID", length = 255)
271 public String getId() {
272 return id;
273 }
274
275
276
277
278
279
280
281
282
283 public void setId(String value) {
284 this.id = value;
285 }
286
287 public IndicatorElement withIndicatorName(String value) {
288 setIndicatorName(value);
289 return this;
290 }
291
292 public IndicatorElement withSource(Source value) {
293 setSource(value);
294 return this;
295 }
296
297 public IndicatorElement withSourceNote(String value) {
298 setSourceNote(value);
299 return this;
300 }
301
302 public IndicatorElement withSourceOrganization(String value) {
303 setSourceOrganization(value);
304 return this;
305 }
306
307 public IndicatorElement withTopics(Topics value) {
308 setTopics(value);
309 return this;
310 }
311
312 public IndicatorElement withId(String value) {
313 setId(value);
314 return this;
315 }
316
317 public String toString() {
318 final ToStringStrategy strategy = JAXBToStringStrategy.INSTANCE;
319 final StringBuilder buffer = new StringBuilder();
320 append(null, buffer, strategy);
321 return buffer.toString();
322 }
323
324 public StringBuilder append(ObjectLocator locator, StringBuilder buffer, ToStringStrategy strategy) {
325 strategy.appendStart(locator, this, buffer);
326 appendFields(locator, buffer, strategy);
327 strategy.appendEnd(locator, this, buffer);
328 return buffer;
329 }
330
331 public StringBuilder appendFields(ObjectLocator locator, StringBuilder buffer, ToStringStrategy strategy) {
332 {
333 String theIndicatorName;
334 theIndicatorName = this.getIndicatorName();
335 strategy.appendField(locator, this, "indicatorName", buffer, theIndicatorName);
336 }
337 {
338 Source theSource;
339 theSource = this.getSource();
340 strategy.appendField(locator, this, "source", buffer, theSource);
341 }
342 {
343 String theSourceNote;
344 theSourceNote = this.getSourceNote();
345 strategy.appendField(locator, this, "sourceNote", buffer, theSourceNote);
346 }
347 {
348 String theSourceOrganization;
349 theSourceOrganization = this.getSourceOrganization();
350 strategy.appendField(locator, this, "sourceOrganization", buffer, theSourceOrganization);
351 }
352 {
353 Topics theTopics;
354 theTopics = this.getTopics();
355 strategy.appendField(locator, this, "topics", buffer, theTopics);
356 }
357 {
358 String theId;
359 theId = this.getId();
360 strategy.appendField(locator, this, "id", buffer, theId);
361 }
362 return buffer;
363 }
364
365
366
367
368
369
370
371
372
373 @Id
374 @Column(name = "HJID")
375 @GeneratedValue(strategy = GenerationType.AUTO)
376 public Long getHjid() {
377 return hjid;
378 }
379
380
381
382
383
384
385
386
387
388 public void setHjid(Long value) {
389 this.hjid = value;
390 }
391
392 public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) {
393 if ((object == null)||(this.getClass()!= object.getClass())) {
394 return false;
395 }
396 if (this == object) {
397 return true;
398 }
399 final IndicatorElement that = ((IndicatorElement) object);
400 {
401 String lhsIndicatorName;
402 lhsIndicatorName = this.getIndicatorName();
403 String rhsIndicatorName;
404 rhsIndicatorName = that.getIndicatorName();
405 if (!strategy.equals(LocatorUtils.property(thisLocator, "indicatorName", lhsIndicatorName), LocatorUtils.property(thatLocator, "indicatorName", rhsIndicatorName), lhsIndicatorName, rhsIndicatorName)) {
406 return false;
407 }
408 }
409 {
410 Source lhsSource;
411 lhsSource = this.getSource();
412 Source rhsSource;
413 rhsSource = that.getSource();
414 if (!strategy.equals(LocatorUtils.property(thisLocator, "source", lhsSource), LocatorUtils.property(thatLocator, "source", rhsSource), lhsSource, rhsSource)) {
415 return false;
416 }
417 }
418 {
419 String lhsSourceNote;
420 lhsSourceNote = this.getSourceNote();
421 String rhsSourceNote;
422 rhsSourceNote = that.getSourceNote();
423 if (!strategy.equals(LocatorUtils.property(thisLocator, "sourceNote", lhsSourceNote), LocatorUtils.property(thatLocator, "sourceNote", rhsSourceNote), lhsSourceNote, rhsSourceNote)) {
424 return false;
425 }
426 }
427 {
428 String lhsSourceOrganization;
429 lhsSourceOrganization = this.getSourceOrganization();
430 String rhsSourceOrganization;
431 rhsSourceOrganization = that.getSourceOrganization();
432 if (!strategy.equals(LocatorUtils.property(thisLocator, "sourceOrganization", lhsSourceOrganization), LocatorUtils.property(thatLocator, "sourceOrganization", rhsSourceOrganization), lhsSourceOrganization, rhsSourceOrganization)) {
433 return false;
434 }
435 }
436 {
437 Topics lhsTopics;
438 lhsTopics = this.getTopics();
439 Topics rhsTopics;
440 rhsTopics = that.getTopics();
441 if (!strategy.equals(LocatorUtils.property(thisLocator, "topics", lhsTopics), LocatorUtils.property(thatLocator, "topics", rhsTopics), lhsTopics, rhsTopics)) {
442 return false;
443 }
444 }
445 {
446 String lhsId;
447 lhsId = this.getId();
448 String rhsId;
449 rhsId = that.getId();
450 if (!strategy.equals(LocatorUtils.property(thisLocator, "id", lhsId), LocatorUtils.property(thatLocator, "id", rhsId), lhsId, rhsId)) {
451 return false;
452 }
453 }
454 return true;
455 }
456
457 public boolean equals(Object object) {
458 final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE;
459 return equals(null, null, object, strategy);
460 }
461
462 public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) {
463 int currentHashCode = 1;
464 {
465 String theIndicatorName;
466 theIndicatorName = this.getIndicatorName();
467 currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "indicatorName", theIndicatorName), currentHashCode, theIndicatorName);
468 }
469 {
470 Source theSource;
471 theSource = this.getSource();
472 currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "source", theSource), currentHashCode, theSource);
473 }
474 {
475 String theSourceNote;
476 theSourceNote = this.getSourceNote();
477 currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "sourceNote", theSourceNote), currentHashCode, theSourceNote);
478 }
479 {
480 String theSourceOrganization;
481 theSourceOrganization = this.getSourceOrganization();
482 currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "sourceOrganization", theSourceOrganization), currentHashCode, theSourceOrganization);
483 }
484 {
485 Topics theTopics;
486 theTopics = this.getTopics();
487 currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "topics", theTopics), currentHashCode, theTopics);
488 }
489 {
490 String theId;
491 theId = this.getId();
492 currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "id", theId), currentHashCode, theId);
493 }
494 return currentHashCode;
495 }
496
497 public int hashCode() {
498 final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE;
499 return this.hashCode(null, strategy);
500 }
501
502 }