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 java.math.BigInteger;
13 import java.util.ArrayList;
14 import java.util.Collection;
15 import java.util.List;
16 import javax.persistence.Basic;
17 import javax.persistence.CascadeType;
18 import javax.persistence.Column;
19 import javax.persistence.Entity;
20 import javax.persistence.GeneratedValue;
21 import javax.persistence.GenerationType;
22 import javax.persistence.Id;
23 import javax.persistence.Inheritance;
24 import javax.persistence.InheritanceType;
25 import javax.persistence.JoinColumn;
26 import javax.persistence.OneToMany;
27 import javax.persistence.Table;
28 import javax.xml.bind.annotation.XmlAccessType;
29 import javax.xml.bind.annotation.XmlAccessorType;
30 import javax.xml.bind.annotation.XmlAttribute;
31 import javax.xml.bind.annotation.XmlElement;
32 import javax.xml.bind.annotation.XmlRootElement;
33 import javax.xml.bind.annotation.XmlType;
34 import com.hack23.cia.model.common.api.ModelObject;
35 import org.jvnet.jaxb2_commons.lang.Equals;
36 import org.jvnet.jaxb2_commons.lang.EqualsStrategy;
37 import org.jvnet.jaxb2_commons.lang.HashCode;
38 import org.jvnet.jaxb2_commons.lang.HashCodeStrategy;
39 import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy;
40 import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy;
41 import org.jvnet.jaxb2_commons.lang.JAXBToStringStrategy;
42 import org.jvnet.jaxb2_commons.lang.ToString;
43 import org.jvnet.jaxb2_commons.lang.ToStringStrategy;
44 import org.jvnet.jaxb2_commons.locator.ObjectLocator;
45 import org.jvnet.jaxb2_commons.locator.util.LocatorUtils;
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 @XmlAccessorType(XmlAccessType.FIELD)
72 @XmlType(name = "", propOrder = {
73 "indicator"
74 })
75 @XmlRootElement(name = "indicators")
76 @Entity(name = "IndicatorsElement")
77 @Table(name = "INDICATORS_ELEMENT")
78 @Inheritance(strategy = InheritanceType.JOINED)
79 public class IndicatorsElement
80 implements Serializable, ModelObject, Equals, HashCode, ToString
81 {
82
83 @XmlElement(required = true)
84 protected List<IndicatorElement> indicator;
85 @XmlAttribute(name = "page")
86 protected BigInteger page;
87 @XmlAttribute(name = "pages")
88 protected BigInteger pages;
89 @XmlAttribute(name = "per_page")
90 protected BigInteger perPage;
91 @XmlAttribute(name = "total")
92 protected BigInteger total;
93 @XmlAttribute(name = "Hjid")
94 protected Long hjid;
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118 @OneToMany(targetEntity = IndicatorElement.class, cascade = {
119 CascadeType.ALL
120 })
121 @JoinColumn(name = "INDICATOR__INDICATORS_ELEMEN_0")
122 public List<IndicatorElement> getIndicator() {
123 if (indicator == null) {
124 indicator = new ArrayList<IndicatorElement>();
125 }
126 return this.indicator;
127 }
128
129
130
131
132
133 public void setIndicator(List<IndicatorElement> indicator) {
134 this.indicator = indicator;
135 }
136
137
138
139
140
141
142
143
144
145 @Basic
146 @Column(name = "PAGE", precision = 20, scale = 0)
147 public BigInteger getPage() {
148 return page;
149 }
150
151
152
153
154
155
156
157
158
159 public void setPage(BigInteger value) {
160 this.page = value;
161 }
162
163
164
165
166
167
168
169
170
171 @Basic
172 @Column(name = "PAGES", precision = 20, scale = 0)
173 public BigInteger getPages() {
174 return pages;
175 }
176
177
178
179
180
181
182
183
184
185 public void setPages(BigInteger value) {
186 this.pages = value;
187 }
188
189
190
191
192
193
194
195
196
197 @Basic
198 @Column(name = "PER_PAGE", precision = 20, scale = 0)
199 public BigInteger getPerPage() {
200 return perPage;
201 }
202
203
204
205
206
207
208
209
210
211 public void setPerPage(BigInteger value) {
212 this.perPage = value;
213 }
214
215
216
217
218
219
220
221
222
223 @Basic
224 @Column(name = "TOTAL", precision = 20, scale = 0)
225 public BigInteger getTotal() {
226 return total;
227 }
228
229
230
231
232
233
234
235
236
237 public void setTotal(BigInteger value) {
238 this.total = value;
239 }
240
241 public IndicatorsElement withIndicator(IndicatorElement... values) {
242 if (values!= null) {
243 for (IndicatorElement value: values) {
244 getIndicator().add(value);
245 }
246 }
247 return this;
248 }
249
250 public IndicatorsElement withIndicator(Collection<IndicatorElement> values) {
251 if (values!= null) {
252 getIndicator().addAll(values);
253 }
254 return this;
255 }
256
257 public IndicatorsElement withIndicator(List<IndicatorElement> indicator) {
258 setIndicator(indicator);
259 return this;
260 }
261
262 public IndicatorsElement withPage(BigInteger value) {
263 setPage(value);
264 return this;
265 }
266
267 public IndicatorsElement withPages(BigInteger value) {
268 setPages(value);
269 return this;
270 }
271
272 public IndicatorsElement withPerPage(BigInteger value) {
273 setPerPage(value);
274 return this;
275 }
276
277 public IndicatorsElement withTotal(BigInteger value) {
278 setTotal(value);
279 return this;
280 }
281
282 public String toString() {
283 final ToStringStrategy strategy = JAXBToStringStrategy.INSTANCE;
284 final StringBuilder buffer = new StringBuilder();
285 append(null, buffer, strategy);
286 return buffer.toString();
287 }
288
289 public StringBuilder append(ObjectLocator locator, StringBuilder buffer, ToStringStrategy strategy) {
290 strategy.appendStart(locator, this, buffer);
291 appendFields(locator, buffer, strategy);
292 strategy.appendEnd(locator, this, buffer);
293 return buffer;
294 }
295
296 public StringBuilder appendFields(ObjectLocator locator, StringBuilder buffer, ToStringStrategy strategy) {
297 {
298 List<IndicatorElement> theIndicator;
299 theIndicator = (((this.indicator!= null)&&(!this.indicator.isEmpty()))?this.getIndicator():null);
300 strategy.appendField(locator, this, "indicator", buffer, theIndicator);
301 }
302 {
303 BigInteger thePage;
304 thePage = this.getPage();
305 strategy.appendField(locator, this, "page", buffer, thePage);
306 }
307 {
308 BigInteger thePages;
309 thePages = this.getPages();
310 strategy.appendField(locator, this, "pages", buffer, thePages);
311 }
312 {
313 BigInteger thePerPage;
314 thePerPage = this.getPerPage();
315 strategy.appendField(locator, this, "perPage", buffer, thePerPage);
316 }
317 {
318 BigInteger theTotal;
319 theTotal = this.getTotal();
320 strategy.appendField(locator, this, "total", buffer, theTotal);
321 }
322 return buffer;
323 }
324
325
326
327
328
329
330
331
332
333 @Id
334 @Column(name = "HJID")
335 @GeneratedValue(strategy = GenerationType.AUTO)
336 public Long getHjid() {
337 return hjid;
338 }
339
340
341
342
343
344
345
346
347
348 public void setHjid(Long value) {
349 this.hjid = value;
350 }
351
352 public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) {
353 if ((object == null)||(this.getClass()!= object.getClass())) {
354 return false;
355 }
356 if (this == object) {
357 return true;
358 }
359 final IndicatorsElement that = ((IndicatorsElement) object);
360 {
361 List<IndicatorElement> lhsIndicator;
362 lhsIndicator = (((this.indicator!= null)&&(!this.indicator.isEmpty()))?this.getIndicator():null);
363 List<IndicatorElement> rhsIndicator;
364 rhsIndicator = (((that.indicator!= null)&&(!that.indicator.isEmpty()))?that.getIndicator():null);
365 if (!strategy.equals(LocatorUtils.property(thisLocator, "indicator", lhsIndicator), LocatorUtils.property(thatLocator, "indicator", rhsIndicator), lhsIndicator, rhsIndicator)) {
366 return false;
367 }
368 }
369 {
370 BigInteger lhsPage;
371 lhsPage = this.getPage();
372 BigInteger rhsPage;
373 rhsPage = that.getPage();
374 if (!strategy.equals(LocatorUtils.property(thisLocator, "page", lhsPage), LocatorUtils.property(thatLocator, "page", rhsPage), lhsPage, rhsPage)) {
375 return false;
376 }
377 }
378 {
379 BigInteger lhsPages;
380 lhsPages = this.getPages();
381 BigInteger rhsPages;
382 rhsPages = that.getPages();
383 if (!strategy.equals(LocatorUtils.property(thisLocator, "pages", lhsPages), LocatorUtils.property(thatLocator, "pages", rhsPages), lhsPages, rhsPages)) {
384 return false;
385 }
386 }
387 {
388 BigInteger lhsPerPage;
389 lhsPerPage = this.getPerPage();
390 BigInteger rhsPerPage;
391 rhsPerPage = that.getPerPage();
392 if (!strategy.equals(LocatorUtils.property(thisLocator, "perPage", lhsPerPage), LocatorUtils.property(thatLocator, "perPage", rhsPerPage), lhsPerPage, rhsPerPage)) {
393 return false;
394 }
395 }
396 {
397 BigInteger lhsTotal;
398 lhsTotal = this.getTotal();
399 BigInteger rhsTotal;
400 rhsTotal = that.getTotal();
401 if (!strategy.equals(LocatorUtils.property(thisLocator, "total", lhsTotal), LocatorUtils.property(thatLocator, "total", rhsTotal), lhsTotal, rhsTotal)) {
402 return false;
403 }
404 }
405 return true;
406 }
407
408 public boolean equals(Object object) {
409 final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE;
410 return equals(null, null, object, strategy);
411 }
412
413 public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) {
414 int currentHashCode = 1;
415 {
416 List<IndicatorElement> theIndicator;
417 theIndicator = (((this.indicator!= null)&&(!this.indicator.isEmpty()))?this.getIndicator():null);
418 currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "indicator", theIndicator), currentHashCode, theIndicator);
419 }
420 {
421 BigInteger thePage;
422 thePage = this.getPage();
423 currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "page", thePage), currentHashCode, thePage);
424 }
425 {
426 BigInteger thePages;
427 thePages = this.getPages();
428 currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "pages", thePages), currentHashCode, thePages);
429 }
430 {
431 BigInteger thePerPage;
432 thePerPage = this.getPerPage();
433 currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "perPage", thePerPage), currentHashCode, thePerPage);
434 }
435 {
436 BigInteger theTotal;
437 theTotal = this.getTotal();
438 currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "total", theTotal), currentHashCode, theTotal);
439 }
440 return currentHashCode;
441 }
442
443 public int hashCode() {
444 final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE;
445 return this.hashCode(null, strategy);
446 }
447
448 }