View Javadoc
1   //
2   // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.11 
3   // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
4   // Any modifications to this file will be lost upon recompilation of the source schema. 
5   // Generated on: 2017.04.23 at 07:21:22 PM CEST 
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   * <p>Java class for IndicatorElement complex type.
48   * 
49   * <p>The following schema fragment specifies the expected content contained within this class.
50   * 
51   * <pre>
52   * &lt;complexType name="IndicatorElement"&gt;
53   *   &lt;complexContent&gt;
54   *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
55   *       &lt;sequence&gt;
56   *         &lt;element name="name" type="{http://www.w3.org/2001/XMLSchema}string" form="qualified"/&gt;
57   *         &lt;element name="source" form="qualified"&gt;
58   *           &lt;complexType&gt;
59   *             &lt;simpleContent&gt;
60   *               &lt;extension base="&lt;http://indicators.worldbank.external.model.cia.hack23.com/impl&gt;SourceNameValue"&gt;
61   *                 &lt;attribute name="id" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
62   *               &lt;/extension&gt;
63   *             &lt;/simpleContent&gt;
64   *           &lt;/complexType&gt;
65   *         &lt;/element&gt;
66   *         &lt;element name="sourceNote" type="{http://www.w3.org/2001/XMLSchema}string" form="qualified"/&gt;
67   *         &lt;element name="sourceOrganization" type="{http://www.w3.org/2001/XMLSchema}string" form="qualified"/&gt;
68   *         &lt;element name="topics" form="qualified"&gt;
69   *           &lt;complexType&gt;
70   *             &lt;complexContent&gt;
71   *               &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
72   *                 &lt;sequence&gt;
73   *                   &lt;element name="topic" maxOccurs="unbounded" minOccurs="0" form="qualified"&gt;
74   *                     &lt;complexType&gt;
75   *                       &lt;simpleContent&gt;
76   *                         &lt;extension base="&lt;http://www.w3.org/2001/XMLSchema&gt;NCName"&gt;
77   *                           &lt;attribute name="id" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
78   *                         &lt;/extension&gt;
79   *                       &lt;/simpleContent&gt;
80   *                     &lt;/complexType&gt;
81   *                   &lt;/element&gt;
82   *                 &lt;/sequence&gt;
83   *               &lt;/restriction&gt;
84   *             &lt;/complexContent&gt;
85   *           &lt;/complexType&gt;
86   *         &lt;/element&gt;
87   *       &lt;/sequence&gt;
88   *       &lt;attribute name="id" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
89   *     &lt;/restriction&gt;
90   *   &lt;/complexContent&gt;
91   * &lt;/complexType&gt;
92   * </pre>
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      * Gets the value of the indicatorName property.
128      * 
129      * @return
130      *     possible object is
131      *     {@link String }
132      *     
133      */
134     @Basic
135     @Column(name = "INDICATOR_NAME", length = 255)
136     public String getIndicatorName() {
137         return indicatorName;
138     }
139 
140     /**
141      * Sets the value of the indicatorName property.
142      * 
143      * @param value
144      *     allowed object is
145      *     {@link String }
146      *     
147      */
148     public void setIndicatorName(String value) {
149         this.indicatorName = value;
150     }
151 
152     /**
153      * Gets the value of the source property.
154      * 
155      * @return
156      *     possible object is
157      *     {@link Source }
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      * Sets the value of the source property.
171      * 
172      * @param value
173      *     allowed object is
174      *     {@link Source }
175      *     
176      */
177     public void setSource(Source value) {
178         this.source = value;
179     }
180 
181     /**
182      * Gets the value of the sourceNote property.
183      * 
184      * @return
185      *     possible object is
186      *     {@link String }
187      *     
188      */
189     @Basic
190     @Column(name = "SOURCE_NOTE", length = 65536)
191     public String getSourceNote() {
192         return sourceNote;
193     }
194 
195     /**
196      * Sets the value of the sourceNote property.
197      * 
198      * @param value
199      *     allowed object is
200      *     {@link String }
201      *     
202      */
203     public void setSourceNote(String value) {
204         this.sourceNote = value;
205     }
206 
207     /**
208      * Gets the value of the sourceOrganization property.
209      * 
210      * @return
211      *     possible object is
212      *     {@link String }
213      *     
214      */
215     @Basic
216     @Column(name = "SOURCE_ORGANIZATION", length = 65536)
217     public String getSourceOrganization() {
218         return sourceOrganization;
219     }
220 
221     /**
222      * Sets the value of the sourceOrganization property.
223      * 
224      * @param value
225      *     allowed object is
226      *     {@link String }
227      *     
228      */
229     public void setSourceOrganization(String value) {
230         this.sourceOrganization = value;
231     }
232 
233     /**
234      * Gets the value of the topics property.
235      * 
236      * @return
237      *     possible object is
238      *     {@link Topics }
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      * Sets the value of the topics property.
251      * 
252      * @param value
253      *     allowed object is
254      *     {@link Topics }
255      *     
256      */
257     public void setTopics(Topics value) {
258         this.topics = value;
259     }
260 
261     /**
262      * Gets the value of the id property.
263      * 
264      * @return
265      *     possible object is
266      *     {@link String }
267      *     
268      */
269     @Basic
270     @Column(name = "ID", length = 255)
271     public String getId() {
272         return id;
273     }
274 
275     /**
276      * Sets the value of the id property.
277      * 
278      * @param value
279      *     allowed object is
280      *     {@link String }
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      * Gets the value of the hjid property.
367      * 
368      * @return
369      *     possible object is
370      *     {@link Long }
371      *     
372      */
373     @Id
374     @Column(name = "HJID")
375     @GeneratedValue(strategy = GenerationType.AUTO)
376     public Long getHjid() {
377         return hjid;
378     }
379 
380     /**
381      * Sets the value of the hjid property.
382      * 
383      * @param value
384      *     allowed object is
385      *     {@link Long }
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 }