1
2
3
4
5
6
7
8
9 package com.hack23.cia.model.external.worldbank.countries.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.Column;
16 import javax.persistence.Embedded;
17 import javax.persistence.Entity;
18 import javax.persistence.GeneratedValue;
19 import javax.persistence.GenerationType;
20 import javax.persistence.Id;
21 import javax.persistence.Inheritance;
22 import javax.persistence.InheritanceType;
23 import javax.persistence.Table;
24 import javax.xml.bind.annotation.XmlAccessType;
25 import javax.xml.bind.annotation.XmlAccessorType;
26 import javax.xml.bind.annotation.XmlAttribute;
27 import javax.xml.bind.annotation.XmlElement;
28 import javax.xml.bind.annotation.XmlRootElement;
29 import javax.xml.bind.annotation.XmlType;
30 import com.hack23.cia.model.common.api.ModelObject;
31 import org.jvnet.jaxb2_commons.lang.Equals;
32 import org.jvnet.jaxb2_commons.lang.EqualsStrategy;
33 import org.jvnet.jaxb2_commons.lang.HashCode;
34 import org.jvnet.jaxb2_commons.lang.HashCodeStrategy;
35 import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy;
36 import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy;
37 import org.jvnet.jaxb2_commons.lang.JAXBToStringStrategy;
38 import org.jvnet.jaxb2_commons.lang.ToString;
39 import org.jvnet.jaxb2_commons.lang.ToStringStrategy;
40 import org.jvnet.jaxb2_commons.locator.ObjectLocator;
41 import org.jvnet.jaxb2_commons.locator.util.LocatorUtils;
42
43
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
97
98
99
100
101
102
103
104 @XmlAccessorType(XmlAccessType.FIELD)
105 @XmlType(name = "", propOrder = {
106 "iso2Code",
107 "countryName",
108 "region",
109 "adminregion",
110 "incomeLevel",
111 "lendingType",
112 "capitalCity",
113 "longitude",
114 "latitude"
115 })
116 @XmlRootElement(name = "country")
117 @Entity(name = "CountryElement")
118 @Table(name = "COUNTRY_ELEMENT")
119 @Inheritance(strategy = InheritanceType.JOINED)
120 public class CountryElement
121 implements Serializable, ModelObject, Equals, HashCode, ToString
122 {
123
124 private final static long serialVersionUID = 1L;
125 @XmlElement(required = true)
126 protected String iso2Code;
127 @XmlElement(name = "name", required = true)
128 protected String countryName;
129 @XmlElement(required = true)
130 protected Region region;
131 @XmlElement(required = true)
132 protected Adminregion adminregion;
133 @XmlElement(required = true)
134 protected IncomeLevel incomeLevel;
135 @XmlElement(required = true)
136 protected LendingType lendingType;
137 @XmlElement(required = true)
138 protected String capitalCity;
139 @XmlElement(required = true)
140 protected String longitude;
141 @XmlElement(required = true)
142 protected String latitude;
143 @XmlAttribute(name = "id")
144 protected String id;
145 @XmlAttribute(name = "Hjid")
146 protected Long hjid;
147
148
149
150
151
152
153
154
155
156 @Basic
157 @Column(name = "ISO_2CODE", length = 255)
158 public String getIso2Code() {
159 return iso2Code;
160 }
161
162
163
164
165
166
167
168
169
170 public void setIso2Code(String value) {
171 this.iso2Code = value;
172 }
173
174
175
176
177
178
179
180
181
182 @Basic
183 @Column(name = "COUNTRY_NAME", length = 255)
184 public String getCountryName() {
185 return countryName;
186 }
187
188
189
190
191
192
193
194
195
196 public void setCountryName(String value) {
197 this.countryName = value;
198 }
199
200
201
202
203
204
205
206
207
208 @Embedded
209 @AttributeOverrides({
210 @AttributeOverride(name = "value", column = @Column(name = "REGION_VALUE", length = 255)),
211 @AttributeOverride(name = "id", column = @Column(name = "REGION_ID", length = 255))
212 })
213 public Region getRegion() {
214 return region;
215 }
216
217
218
219
220
221
222
223
224
225 public void setRegion(Region value) {
226 this.region = value;
227 }
228
229
230
231
232
233
234
235
236
237 @Embedded
238 @AttributeOverrides({
239 @AttributeOverride(name = "value", column = @Column(name = "ADMINREGION_VALUE", length = 255)),
240 @AttributeOverride(name = "id", column = @Column(name = "ADMINREGION_ID", length = 255))
241 })
242 public Adminregion getAdminregion() {
243 return adminregion;
244 }
245
246
247
248
249
250
251
252
253
254 public void setAdminregion(Adminregion value) {
255 this.adminregion = value;
256 }
257
258
259
260
261
262
263
264
265
266 @Embedded
267 @AttributeOverrides({
268 @AttributeOverride(name = "value", column = @Column(name = "INCOME_LEVEL_VALUE", length = 255)),
269 @AttributeOverride(name = "id", column = @Column(name = "INCOME_LEVEL_ID", length = 255))
270 })
271 public IncomeLevel getIncomeLevel() {
272 return incomeLevel;
273 }
274
275
276
277
278
279
280
281
282
283 public void setIncomeLevel(IncomeLevel value) {
284 this.incomeLevel = value;
285 }
286
287
288
289
290
291
292
293
294
295 @Embedded
296 @AttributeOverrides({
297 @AttributeOverride(name = "value", column = @Column(name = "LENDING_TYPE_VALUE", length = 255)),
298 @AttributeOverride(name = "id", column = @Column(name = "LENDING_TYPE_ID", length = 255))
299 })
300 public LendingType getLendingType() {
301 return lendingType;
302 }
303
304
305
306
307
308
309
310
311
312 public void setLendingType(LendingType value) {
313 this.lendingType = value;
314 }
315
316
317
318
319
320
321
322
323
324 @Basic
325 @Column(name = "CAPITAL_CITY", length = 255)
326 public String getCapitalCity() {
327 return capitalCity;
328 }
329
330
331
332
333
334
335
336
337
338 public void setCapitalCity(String value) {
339 this.capitalCity = value;
340 }
341
342
343
344
345
346
347
348
349
350 @Basic
351 @Column(name = "LONGITUDE", length = 255)
352 public String getLongitude() {
353 return longitude;
354 }
355
356
357
358
359
360
361
362
363
364 public void setLongitude(String value) {
365 this.longitude = value;
366 }
367
368
369
370
371
372
373
374
375
376 @Basic
377 @Column(name = "LATITUDE", length = 255)
378 public String getLatitude() {
379 return latitude;
380 }
381
382
383
384
385
386
387
388
389
390 public void setLatitude(String value) {
391 this.latitude = value;
392 }
393
394
395
396
397
398
399
400
401
402 @Basic
403 @Column(name = "ID", length = 255)
404 public String getId() {
405 return id;
406 }
407
408
409
410
411
412
413
414
415
416 public void setId(String value) {
417 this.id = value;
418 }
419
420 public CountryElement withIso2Code(String value) {
421 setIso2Code(value);
422 return this;
423 }
424
425 public CountryElement withCountryName(String value) {
426 setCountryName(value);
427 return this;
428 }
429
430 public CountryElement withRegion(Region value) {
431 setRegion(value);
432 return this;
433 }
434
435 public CountryElement withAdminregion(Adminregion value) {
436 setAdminregion(value);
437 return this;
438 }
439
440 public CountryElement withIncomeLevel(IncomeLevel value) {
441 setIncomeLevel(value);
442 return this;
443 }
444
445 public CountryElement withLendingType(LendingType value) {
446 setLendingType(value);
447 return this;
448 }
449
450 public CountryElement withCapitalCity(String value) {
451 setCapitalCity(value);
452 return this;
453 }
454
455 public CountryElement withLongitude(String value) {
456 setLongitude(value);
457 return this;
458 }
459
460 public CountryElement withLatitude(String value) {
461 setLatitude(value);
462 return this;
463 }
464
465 public CountryElement withId(String value) {
466 setId(value);
467 return this;
468 }
469
470 public String toString() {
471 final ToStringStrategy strategy = JAXBToStringStrategy.INSTANCE;
472 final StringBuilder buffer = new StringBuilder();
473 append(null, buffer, strategy);
474 return buffer.toString();
475 }
476
477 public StringBuilder append(ObjectLocator locator, StringBuilder buffer, ToStringStrategy strategy) {
478 strategy.appendStart(locator, this, buffer);
479 appendFields(locator, buffer, strategy);
480 strategy.appendEnd(locator, this, buffer);
481 return buffer;
482 }
483
484 public StringBuilder appendFields(ObjectLocator locator, StringBuilder buffer, ToStringStrategy strategy) {
485 {
486 String theIso2Code;
487 theIso2Code = this.getIso2Code();
488 strategy.appendField(locator, this, "iso2Code", buffer, theIso2Code);
489 }
490 {
491 String theCountryName;
492 theCountryName = this.getCountryName();
493 strategy.appendField(locator, this, "countryName", buffer, theCountryName);
494 }
495 {
496 Region theRegion;
497 theRegion = this.getRegion();
498 strategy.appendField(locator, this, "region", buffer, theRegion);
499 }
500 {
501 Adminregion theAdminregion;
502 theAdminregion = this.getAdminregion();
503 strategy.appendField(locator, this, "adminregion", buffer, theAdminregion);
504 }
505 {
506 IncomeLevel theIncomeLevel;
507 theIncomeLevel = this.getIncomeLevel();
508 strategy.appendField(locator, this, "incomeLevel", buffer, theIncomeLevel);
509 }
510 {
511 LendingType theLendingType;
512 theLendingType = this.getLendingType();
513 strategy.appendField(locator, this, "lendingType", buffer, theLendingType);
514 }
515 {
516 String theCapitalCity;
517 theCapitalCity = this.getCapitalCity();
518 strategy.appendField(locator, this, "capitalCity", buffer, theCapitalCity);
519 }
520 {
521 String theLongitude;
522 theLongitude = this.getLongitude();
523 strategy.appendField(locator, this, "longitude", buffer, theLongitude);
524 }
525 {
526 String theLatitude;
527 theLatitude = this.getLatitude();
528 strategy.appendField(locator, this, "latitude", buffer, theLatitude);
529 }
530 {
531 String theId;
532 theId = this.getId();
533 strategy.appendField(locator, this, "id", buffer, theId);
534 }
535 return buffer;
536 }
537
538
539
540
541
542
543
544
545
546 @Id
547 @Column(name = "HJID")
548 @GeneratedValue(strategy = GenerationType.AUTO)
549 public Long getHjid() {
550 return hjid;
551 }
552
553
554
555
556
557
558
559
560
561 public void setHjid(Long value) {
562 this.hjid = value;
563 }
564
565 public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) {
566 if ((object == null)||(this.getClass()!= object.getClass())) {
567 return false;
568 }
569 if (this == object) {
570 return true;
571 }
572 final CountryElement that = ((CountryElement) object);
573 {
574 String lhsIso2Code;
575 lhsIso2Code = this.getIso2Code();
576 String rhsIso2Code;
577 rhsIso2Code = that.getIso2Code();
578 if (!strategy.equals(LocatorUtils.property(thisLocator, "iso2Code", lhsIso2Code), LocatorUtils.property(thatLocator, "iso2Code", rhsIso2Code), lhsIso2Code, rhsIso2Code)) {
579 return false;
580 }
581 }
582 {
583 String lhsCountryName;
584 lhsCountryName = this.getCountryName();
585 String rhsCountryName;
586 rhsCountryName = that.getCountryName();
587 if (!strategy.equals(LocatorUtils.property(thisLocator, "countryName", lhsCountryName), LocatorUtils.property(thatLocator, "countryName", rhsCountryName), lhsCountryName, rhsCountryName)) {
588 return false;
589 }
590 }
591 {
592 Region lhsRegion;
593 lhsRegion = this.getRegion();
594 Region rhsRegion;
595 rhsRegion = that.getRegion();
596 if (!strategy.equals(LocatorUtils.property(thisLocator, "region", lhsRegion), LocatorUtils.property(thatLocator, "region", rhsRegion), lhsRegion, rhsRegion)) {
597 return false;
598 }
599 }
600 {
601 Adminregion lhsAdminregion;
602 lhsAdminregion = this.getAdminregion();
603 Adminregion rhsAdminregion;
604 rhsAdminregion = that.getAdminregion();
605 if (!strategy.equals(LocatorUtils.property(thisLocator, "adminregion", lhsAdminregion), LocatorUtils.property(thatLocator, "adminregion", rhsAdminregion), lhsAdminregion, rhsAdminregion)) {
606 return false;
607 }
608 }
609 {
610 IncomeLevel lhsIncomeLevel;
611 lhsIncomeLevel = this.getIncomeLevel();
612 IncomeLevel rhsIncomeLevel;
613 rhsIncomeLevel = that.getIncomeLevel();
614 if (!strategy.equals(LocatorUtils.property(thisLocator, "incomeLevel", lhsIncomeLevel), LocatorUtils.property(thatLocator, "incomeLevel", rhsIncomeLevel), lhsIncomeLevel, rhsIncomeLevel)) {
615 return false;
616 }
617 }
618 {
619 LendingType lhsLendingType;
620 lhsLendingType = this.getLendingType();
621 LendingType rhsLendingType;
622 rhsLendingType = that.getLendingType();
623 if (!strategy.equals(LocatorUtils.property(thisLocator, "lendingType", lhsLendingType), LocatorUtils.property(thatLocator, "lendingType", rhsLendingType), lhsLendingType, rhsLendingType)) {
624 return false;
625 }
626 }
627 {
628 String lhsCapitalCity;
629 lhsCapitalCity = this.getCapitalCity();
630 String rhsCapitalCity;
631 rhsCapitalCity = that.getCapitalCity();
632 if (!strategy.equals(LocatorUtils.property(thisLocator, "capitalCity", lhsCapitalCity), LocatorUtils.property(thatLocator, "capitalCity", rhsCapitalCity), lhsCapitalCity, rhsCapitalCity)) {
633 return false;
634 }
635 }
636 {
637 String lhsLongitude;
638 lhsLongitude = this.getLongitude();
639 String rhsLongitude;
640 rhsLongitude = that.getLongitude();
641 if (!strategy.equals(LocatorUtils.property(thisLocator, "longitude", lhsLongitude), LocatorUtils.property(thatLocator, "longitude", rhsLongitude), lhsLongitude, rhsLongitude)) {
642 return false;
643 }
644 }
645 {
646 String lhsLatitude;
647 lhsLatitude = this.getLatitude();
648 String rhsLatitude;
649 rhsLatitude = that.getLatitude();
650 if (!strategy.equals(LocatorUtils.property(thisLocator, "latitude", lhsLatitude), LocatorUtils.property(thatLocator, "latitude", rhsLatitude), lhsLatitude, rhsLatitude)) {
651 return false;
652 }
653 }
654 {
655 String lhsId;
656 lhsId = this.getId();
657 String rhsId;
658 rhsId = that.getId();
659 if (!strategy.equals(LocatorUtils.property(thisLocator, "id", lhsId), LocatorUtils.property(thatLocator, "id", rhsId), lhsId, rhsId)) {
660 return false;
661 }
662 }
663 return true;
664 }
665
666 public boolean equals(Object object) {
667 final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE;
668 return equals(null, null, object, strategy);
669 }
670
671 public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) {
672 int currentHashCode = 1;
673 {
674 String theIso2Code;
675 theIso2Code = this.getIso2Code();
676 currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "iso2Code", theIso2Code), currentHashCode, theIso2Code);
677 }
678 {
679 String theCountryName;
680 theCountryName = this.getCountryName();
681 currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "countryName", theCountryName), currentHashCode, theCountryName);
682 }
683 {
684 Region theRegion;
685 theRegion = this.getRegion();
686 currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "region", theRegion), currentHashCode, theRegion);
687 }
688 {
689 Adminregion theAdminregion;
690 theAdminregion = this.getAdminregion();
691 currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "adminregion", theAdminregion), currentHashCode, theAdminregion);
692 }
693 {
694 IncomeLevel theIncomeLevel;
695 theIncomeLevel = this.getIncomeLevel();
696 currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "incomeLevel", theIncomeLevel), currentHashCode, theIncomeLevel);
697 }
698 {
699 LendingType theLendingType;
700 theLendingType = this.getLendingType();
701 currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "lendingType", theLendingType), currentHashCode, theLendingType);
702 }
703 {
704 String theCapitalCity;
705 theCapitalCity = this.getCapitalCity();
706 currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "capitalCity", theCapitalCity), currentHashCode, theCapitalCity);
707 }
708 {
709 String theLongitude;
710 theLongitude = this.getLongitude();
711 currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "longitude", theLongitude), currentHashCode, theLongitude);
712 }
713 {
714 String theLatitude;
715 theLatitude = this.getLatitude();
716 currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "latitude", theLatitude), currentHashCode, theLatitude);
717 }
718 {
719 String theId;
720 theId = this.getId();
721 currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "id", theId), currentHashCode, theId);
722 }
723 return currentHashCode;
724 }
725
726 public int hashCode() {
727 final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE;
728 return this.hashCode(null, strategy);
729 }
730
731 }