IndicatorElement.java
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.11
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2018.10.06 at 11:55:17 AM CEST
//
package com.hack23.cia.model.external.worldbank.indicators.impl;
import java.io.Serializable;
import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Embedded;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
import com.hack23.cia.model.common.api.ModelObject;
import org.jvnet.jaxb2_commons.lang.Equals;
import org.jvnet.jaxb2_commons.lang.EqualsStrategy;
import org.jvnet.jaxb2_commons.lang.HashCode;
import org.jvnet.jaxb2_commons.lang.HashCodeStrategy;
import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy;
import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy;
import org.jvnet.jaxb2_commons.lang.JAXBToStringStrategy;
import org.jvnet.jaxb2_commons.lang.ToString;
import org.jvnet.jaxb2_commons.lang.ToStringStrategy;
import org.jvnet.jaxb2_commons.locator.ObjectLocator;
import org.jvnet.jaxb2_commons.locator.util.LocatorUtils;
/**
* <p>Java class for IndicatorElement complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="IndicatorElement">
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="name" type="{http://www.w3.org/2001/XMLSchema}string" form="qualified"/>
* <element name="source" form="qualified">
* <complexType>
* <simpleContent>
* <extension base="<http://indicators.worldbank.external.model.cia.hack23.com/impl>SourceNameValue">
* <attribute name="id" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
* </extension>
* </simpleContent>
* </complexType>
* </element>
* <element name="sourceNote" type="{http://www.w3.org/2001/XMLSchema}string" form="qualified"/>
* <element name="sourceOrganization" type="{http://www.w3.org/2001/XMLSchema}string" form="qualified"/>
* <element name="topics" form="qualified">
* <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="topic" maxOccurs="unbounded" minOccurs="0" form="qualified">
* <complexType>
* <simpleContent>
* <extension base="<http://www.w3.org/2001/XMLSchema>NCName">
* <attribute name="id" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
* </extension>
* </simpleContent>
* </complexType>
* </element>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </element>
* </sequence>
* <attribute name="id" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "IndicatorElement", propOrder = {
"indicatorName",
"source",
"sourceNote",
"sourceOrganization",
"topics"
})
@Entity(name = "IndicatorElement")
@Table(name = "INDICATOR_ELEMENT")
@Inheritance(strategy = InheritanceType.JOINED)
public class IndicatorElement
implements Serializable, ModelObject, Equals, HashCode, ToString
{
@XmlElement(name = "name", required = true)
protected String indicatorName;
@XmlElement(required = true)
protected Source source;
@XmlElement(required = true)
protected String sourceNote;
@XmlElement(required = true)
protected String sourceOrganization;
@XmlElement(required = true)
protected Topics topics;
@XmlAttribute(name = "id", required = true)
protected String id;
@XmlAttribute(name = "Hjid")
protected Long hjid;
/**
* Gets the value of the indicatorName property.
*
* @return
* possible object is
* {@link String }
*
*/
@Basic
@Column(name = "INDICATOR_NAME", length = 255)
public String getIndicatorName() {
return indicatorName;
}
/**
* Sets the value of the indicatorName property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setIndicatorName(String value) {
this.indicatorName = value;
}
/**
* Gets the value of the source property.
*
* @return
* possible object is
* {@link Source }
*
*/
@Embedded
@AttributeOverrides({
@AttributeOverride(name = "value", column = @Column(name = "SOURCE_VALUE", length = 255)),
@AttributeOverride(name = "id", column = @Column(name = "SOURCE_ID", length = 255))
})
public Source getSource() {
return source;
}
/**
* Sets the value of the source property.
*
* @param value
* allowed object is
* {@link Source }
*
*/
public void setSource(Source value) {
this.source = value;
}
/**
* Gets the value of the sourceNote property.
*
* @return
* possible object is
* {@link String }
*
*/
@Basic
@Column(name = "SOURCE_NOTE", length = 65536)
public String getSourceNote() {
return sourceNote;
}
/**
* Sets the value of the sourceNote property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setSourceNote(String value) {
this.sourceNote = value;
}
/**
* Gets the value of the sourceOrganization property.
*
* @return
* possible object is
* {@link String }
*
*/
@Basic
@Column(name = "SOURCE_ORGANIZATION", length = 65536)
public String getSourceOrganization() {
return sourceOrganization;
}
/**
* Sets the value of the sourceOrganization property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setSourceOrganization(String value) {
this.sourceOrganization = value;
}
/**
* Gets the value of the topics property.
*
* @return
* possible object is
* {@link Topics }
*
*/
@ManyToOne(targetEntity = Topics.class, cascade = {
CascadeType.ALL
})
@JoinColumn(name = "TOPICS_INDICATOR_ELEMENT_HJID")
public Topics getTopics() {
return topics;
}
/**
* Sets the value of the topics property.
*
* @param value
* allowed object is
* {@link Topics }
*
*/
public void setTopics(Topics value) {
this.topics = value;
}
/**
* Gets the value of the id property.
*
* @return
* possible object is
* {@link String }
*
*/
@Basic
@Column(name = "ID", length = 255)
public String getId() {
return id;
}
/**
* Sets the value of the id property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setId(String value) {
this.id = value;
}
public IndicatorElement withIndicatorName(String value) {
setIndicatorName(value);
return this;
}
public IndicatorElement withSource(Source value) {
setSource(value);
return this;
}
public IndicatorElement withSourceNote(String value) {
setSourceNote(value);
return this;
}
public IndicatorElement withSourceOrganization(String value) {
setSourceOrganization(value);
return this;
}
public IndicatorElement withTopics(Topics value) {
setTopics(value);
return this;
}
public IndicatorElement withId(String value) {
setId(value);
return this;
}
public String toString() {
final ToStringStrategy strategy = JAXBToStringStrategy.INSTANCE;
final StringBuilder buffer = new StringBuilder();
append(null, buffer, strategy);
return buffer.toString();
}
public StringBuilder append(ObjectLocator locator, StringBuilder buffer, ToStringStrategy strategy) {
strategy.appendStart(locator, this, buffer);
appendFields(locator, buffer, strategy);
strategy.appendEnd(locator, this, buffer);
return buffer;
}
public StringBuilder appendFields(ObjectLocator locator, StringBuilder buffer, ToStringStrategy strategy) {
{
String theIndicatorName;
theIndicatorName = this.getIndicatorName();
strategy.appendField(locator, this, "indicatorName", buffer, theIndicatorName);
}
{
Source theSource;
theSource = this.getSource();
strategy.appendField(locator, this, "source", buffer, theSource);
}
{
String theSourceNote;
theSourceNote = this.getSourceNote();
strategy.appendField(locator, this, "sourceNote", buffer, theSourceNote);
}
{
String theSourceOrganization;
theSourceOrganization = this.getSourceOrganization();
strategy.appendField(locator, this, "sourceOrganization", buffer, theSourceOrganization);
}
{
Topics theTopics;
theTopics = this.getTopics();
strategy.appendField(locator, this, "topics", buffer, theTopics);
}
{
String theId;
theId = this.getId();
strategy.appendField(locator, this, "id", buffer, theId);
}
return buffer;
}
/**
* Gets the value of the hjid property.
*
* @return
* possible object is
* {@link Long }
*
*/
@Id
@Column(name = "HJID")
@GeneratedValue(strategy = GenerationType.AUTO)
public Long getHjid() {
return hjid;
}
/**
* Sets the value of the hjid property.
*
* @param value
* allowed object is
* {@link Long }
*
*/
public void setHjid(Long value) {
this.hjid = value;
}
public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) {
if ((object == null)||(this.getClass()!= object.getClass())) {
return false;
}
if (this == object) {
return true;
}
final IndicatorElement that = ((IndicatorElement) object);
{
String lhsIndicatorName;
lhsIndicatorName = this.getIndicatorName();
String rhsIndicatorName;
rhsIndicatorName = that.getIndicatorName();
if (!strategy.equals(LocatorUtils.property(thisLocator, "indicatorName", lhsIndicatorName), LocatorUtils.property(thatLocator, "indicatorName", rhsIndicatorName), lhsIndicatorName, rhsIndicatorName)) {
return false;
}
}
{
Source lhsSource;
lhsSource = this.getSource();
Source rhsSource;
rhsSource = that.getSource();
if (!strategy.equals(LocatorUtils.property(thisLocator, "source", lhsSource), LocatorUtils.property(thatLocator, "source", rhsSource), lhsSource, rhsSource)) {
return false;
}
}
{
String lhsSourceNote;
lhsSourceNote = this.getSourceNote();
String rhsSourceNote;
rhsSourceNote = that.getSourceNote();
if (!strategy.equals(LocatorUtils.property(thisLocator, "sourceNote", lhsSourceNote), LocatorUtils.property(thatLocator, "sourceNote", rhsSourceNote), lhsSourceNote, rhsSourceNote)) {
return false;
}
}
{
String lhsSourceOrganization;
lhsSourceOrganization = this.getSourceOrganization();
String rhsSourceOrganization;
rhsSourceOrganization = that.getSourceOrganization();
if (!strategy.equals(LocatorUtils.property(thisLocator, "sourceOrganization", lhsSourceOrganization), LocatorUtils.property(thatLocator, "sourceOrganization", rhsSourceOrganization), lhsSourceOrganization, rhsSourceOrganization)) {
return false;
}
}
{
Topics lhsTopics;
lhsTopics = this.getTopics();
Topics rhsTopics;
rhsTopics = that.getTopics();
if (!strategy.equals(LocatorUtils.property(thisLocator, "topics", lhsTopics), LocatorUtils.property(thatLocator, "topics", rhsTopics), lhsTopics, rhsTopics)) {
return false;
}
}
{
String lhsId;
lhsId = this.getId();
String rhsId;
rhsId = that.getId();
if (!strategy.equals(LocatorUtils.property(thisLocator, "id", lhsId), LocatorUtils.property(thatLocator, "id", rhsId), lhsId, rhsId)) {
return false;
}
}
return true;
}
public boolean equals(Object object) {
final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE;
return equals(null, null, object, strategy);
}
public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) {
int currentHashCode = 1;
{
String theIndicatorName;
theIndicatorName = this.getIndicatorName();
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "indicatorName", theIndicatorName), currentHashCode, theIndicatorName);
}
{
Source theSource;
theSource = this.getSource();
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "source", theSource), currentHashCode, theSource);
}
{
String theSourceNote;
theSourceNote = this.getSourceNote();
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "sourceNote", theSourceNote), currentHashCode, theSourceNote);
}
{
String theSourceOrganization;
theSourceOrganization = this.getSourceOrganization();
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "sourceOrganization", theSourceOrganization), currentHashCode, theSourceOrganization);
}
{
Topics theTopics;
theTopics = this.getTopics();
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "topics", theTopics), currentHashCode, theTopics);
}
{
String theId;
theId = this.getId();
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "id", theId), currentHashCode, theId);
}
return currentHashCode;
}
public int hashCode() {
final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE;
return this.hashCode(null, strategy);
}
}