model.external.worldbank.indicators.impl/src/main/java/com/hack23/cia/model/external/worldbank/indicators/impl/IndicatorElement.java

Summary

Maintainability
A
2 hrs
Test Coverage
/*
 * Copyright 2010 James Pether Sörling
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 *    $Id$
 *  $HeadURL$
*/
// 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: 2019.02.24 at 11:39:42 PM CET
//


package com.hack23.cia.model.external.worldbank.indicators.impl;

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 org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import com.hack23.cia.model.common.api.ModelObject;


/**
 * The Class IndicatorElement.
 */
@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 ModelObject {

    /**
     *
     */
    private static final long serialVersionUID = 1L;

    /** The indicator name. */
    @XmlElement(name = "name", required = true)
    protected String indicatorName;

    /** The source. */
    @XmlElement(required = true)
    protected Source source;

    /** The source note. */
    @XmlElement(required = true)
    protected String sourceNote;

    /** The source organization. */
    @XmlElement(required = true)
    protected String sourceOrganization;

    /** The topics. */
    @XmlElement(required = true)
    protected Topics topics;

    /** The id. */
    @XmlAttribute(name = "id", required = true)
    protected String id;

    /** The hjid. */
    @XmlAttribute(name = "Hjid")
    protected Long hjid;

    /**
     * Gets the indicator name.
     *
     * @return the indicator name
     */
    @Basic
    @Column(name = "INDICATOR_NAME")
    public String getIndicatorName() {
        return indicatorName;
    }

    /**
     * Sets the indicator name.
     *
     * @param value the new indicator name
     */
    public void setIndicatorName(final String value) {
        this.indicatorName = value;
    }

    /**
     * Gets the source.
     *
     * @return the source
     */
    @Embedded
    @AttributeOverrides({
        @AttributeOverride(name = "value", column = @Column(name = "SOURCE_VALUE")),
        @AttributeOverride(name = "id", column = @Column(name = "SOURCE_ID"))
    })
    public Source getSource() {
        return source;
    }

    /**
     * Sets the source.
     *
     * @param value the new source
     */
    public void setSource(final Source value) {
        this.source = value;
    }

    /**
     * Gets the source note.
     *
     * @return the source note
     */
    @Basic
    @Column(name = "SOURCE_NOTE", length = 65536)
    public String getSourceNote() {
        return sourceNote;
    }

    /**
     * Sets the source note.
     *
     * @param value the new source note
     */
    public void setSourceNote(final String value) {
        this.sourceNote = value;
    }

    /**
     * Gets the source organization.
     *
     * @return the source organization
     */
    @Basic
    @Column(name = "SOURCE_ORGANIZATION", length = 65536)
    public String getSourceOrganization() {
        return sourceOrganization;
    }

    /**
     * Sets the source organization.
     *
     * @param value the new source organization
     */
    public void setSourceOrganization(final String value) {
        this.sourceOrganization = value;
    }

    /**
     * Gets the topics.
     *
     * @return the topics
     */
    @ManyToOne(targetEntity = Topics.class, cascade = {
        CascadeType.ALL
    })
    @JoinColumn(name = "TOPICS_INDICATOR_ELEMENT_HJID")
    public Topics getTopics() {
        return topics;
    }

    /**
     * Sets the topics.
     *
     * @param value the new topics
     */
    public void setTopics(final Topics value) {
        this.topics = value;
    }

    /**
     * Gets the id.
     *
     * @return the id
     */
    @Basic
    @Column(name = "ID")
    public String getId() {
        return id;
    }

    /**
     * Sets the id.
     *
     * @param value the new id
     */
    public void setId(final String value) {
        this.id = value;
    }

    /**
     * With indicator name.
     *
     * @param value the value
     * @return the indicator element
     */
    public IndicatorElement withIndicatorName(final String value) {
        setIndicatorName(value);
        return this;
    }

    /**
     * With source.
     *
     * @param value the value
     * @return the indicator element
     */
    public IndicatorElement withSource(final Source value) {
        setSource(value);
        return this;
    }

    /**
     * With source note.
     *
     * @param value the value
     * @return the indicator element
     */
    public IndicatorElement withSourceNote(final String value) {
        setSourceNote(value);
        return this;
    }

    /**
     * With source organization.
     *
     * @param value the value
     * @return the indicator element
     */
    public IndicatorElement withSourceOrganization(final String value) {
        setSourceOrganization(value);
        return this;
    }

    /**
     * With topics.
     *
     * @param value the value
     * @return the indicator element
     */
    public IndicatorElement withTopics(final Topics value) {
        setTopics(value);
        return this;
    }

    /**
     * With id.
     *
     * @param value the value
     * @return the indicator element
     */
    public IndicatorElement withId(final String value) {
        setId(value);
        return this;
    }

    /* (non-Javadoc)
     * @see java.lang.Object#toString()
     */
    @Override
    public final String toString() {
        return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE);
    }


    /**
     * Gets the hjid.
     *
     * @return the hjid
     */
    @Id
    @Column(name = "HJID")
    @GeneratedValue(strategy = GenerationType.AUTO)
    public Long getHjid() {
        return hjid;
    }

    /**
     * Sets the hjid.
     *
     * @param value the new hjid
     */
    public void setHjid(final Long value) {
        this.hjid = value;
    }

    /* (non-Javadoc)
     * @see java.lang.Object#equals(java.lang.Object)
     */
    @Override
    public boolean equals(final Object object) {
        return EqualsBuilder.reflectionEquals(this,object,"hjid");
    }

    /* (non-Javadoc)
     * @see java.lang.Object#hashCode()
     */
    @Override
    public final int hashCode() {
        return HashCodeBuilder.reflectionHashCode(this);
    }

}