SwedenCountyElectoralRegion.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:56:21 AM CEST
//
package com.hack23.cia.model.external.val.landstingvalkrets.impl;
import java.io.Serializable;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
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.OneToMany;
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.locator.ObjectLocator;
import org.jvnet.jaxb2_commons.locator.util.LocatorUtils;
/**
* <p>Java class for SwedenCountyElectoralRegion complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="SwedenCountyElectoralRegion">
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="landstingskod" type="{http://www.w3.org/2001/XMLSchema}integer"/>
* <element name="landstingsnamn" type="{http://www.w3.org/2001/XMLSchema}string"/>
* <element name="valkretsmandat" type="{http://www.w3.org/2001/XMLSchema}integer"/>
* <element name="landstingsvalkrets" type="{http://landstingvalkrets.val.external.model.cia.hack23.com/impl}SwedenCountyElectoralArea" maxOccurs="unbounded"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "SwedenCountyElectoralRegion", propOrder = {
"code",
"countyName",
"seats",
"landstingsvalkrets"
})
@Entity(name = "SwedenCountyElectoralRegion")
@Table(name = "SWEDEN_COUNTY_ELECTORAL_REGI_1")
@Inheritance(strategy = InheritanceType.JOINED)
public class SwedenCountyElectoralRegion
implements Serializable, ModelObject, Equals, HashCode
{
@XmlElement(name = "landstingskod", required = true)
protected BigInteger code;
@XmlElement(name = "landstingsnamn", required = true)
protected String countyName;
@XmlElement(name = "valkretsmandat", required = true)
protected BigInteger seats;
@XmlElement(required = true)
protected List<SwedenCountyElectoralArea> landstingsvalkrets;
@XmlAttribute(name = "Hjid")
protected Long hjid;
/**
* Gets the value of the code property.
*
* @return
* possible object is
* {@link BigInteger }
*
*/
@Basic
@Column(name = "CODE", precision = 20, scale = 0)
public BigInteger getCode() {
return code;
}
/**
* Sets the value of the code property.
*
* @param value
* allowed object is
* {@link BigInteger }
*
*/
public void setCode(BigInteger value) {
this.code = value;
}
/**
* Gets the value of the countyName property.
*
* @return
* possible object is
* {@link String }
*
*/
@Basic
@Column(name = "COUNTY_NAME", length = 255)
public String getCountyName() {
return countyName;
}
/**
* Sets the value of the countyName property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setCountyName(String value) {
this.countyName = value;
}
/**
* Gets the value of the seats property.
*
* @return
* possible object is
* {@link BigInteger }
*
*/
@Basic
@Column(name = "SEATS", precision = 20, scale = 0)
public BigInteger getSeats() {
return seats;
}
/**
* Sets the value of the seats property.
*
* @param value
* allowed object is
* {@link BigInteger }
*
*/
public void setSeats(BigInteger value) {
this.seats = value;
}
/**
* Gets the value of the landstingsvalkrets property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the landstingsvalkrets property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getLandstingsvalkrets().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link SwedenCountyElectoralArea }
*
*
*/
@OneToMany(targetEntity = SwedenCountyElectoralArea.class, cascade = {
CascadeType.ALL
})
@JoinColumn(name = "LANDSTINGSVALKRETS_SWEDEN_CO_0")
public List<SwedenCountyElectoralArea> getLandstingsvalkrets() {
if (landstingsvalkrets == null) {
landstingsvalkrets = new ArrayList<SwedenCountyElectoralArea>();
}
return this.landstingsvalkrets;
}
/**
*
*
*/
public void setLandstingsvalkrets(List<SwedenCountyElectoralArea> landstingsvalkrets) {
this.landstingsvalkrets = landstingsvalkrets;
}
/**
* 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 SwedenCountyElectoralRegion that = ((SwedenCountyElectoralRegion) object);
{
BigInteger lhsCode;
lhsCode = this.getCode();
BigInteger rhsCode;
rhsCode = that.getCode();
if (!strategy.equals(LocatorUtils.property(thisLocator, "code", lhsCode), LocatorUtils.property(thatLocator, "code", rhsCode), lhsCode, rhsCode)) {
return false;
}
}
{
String lhsCountyName;
lhsCountyName = this.getCountyName();
String rhsCountyName;
rhsCountyName = that.getCountyName();
if (!strategy.equals(LocatorUtils.property(thisLocator, "countyName", lhsCountyName), LocatorUtils.property(thatLocator, "countyName", rhsCountyName), lhsCountyName, rhsCountyName)) {
return false;
}
}
{
BigInteger lhsSeats;
lhsSeats = this.getSeats();
BigInteger rhsSeats;
rhsSeats = that.getSeats();
if (!strategy.equals(LocatorUtils.property(thisLocator, "seats", lhsSeats), LocatorUtils.property(thatLocator, "seats", rhsSeats), lhsSeats, rhsSeats)) {
return false;
}
}
{
List<SwedenCountyElectoralArea> lhsLandstingsvalkrets;
lhsLandstingsvalkrets = (((this.landstingsvalkrets!= null)&&(!this.landstingsvalkrets.isEmpty()))?this.getLandstingsvalkrets():null);
List<SwedenCountyElectoralArea> rhsLandstingsvalkrets;
rhsLandstingsvalkrets = (((that.landstingsvalkrets!= null)&&(!that.landstingsvalkrets.isEmpty()))?that.getLandstingsvalkrets():null);
if (!strategy.equals(LocatorUtils.property(thisLocator, "landstingsvalkrets", lhsLandstingsvalkrets), LocatorUtils.property(thatLocator, "landstingsvalkrets", rhsLandstingsvalkrets), lhsLandstingsvalkrets, rhsLandstingsvalkrets)) {
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;
{
BigInteger theCode;
theCode = this.getCode();
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "code", theCode), currentHashCode, theCode);
}
{
String theCountyName;
theCountyName = this.getCountyName();
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "countyName", theCountyName), currentHashCode, theCountyName);
}
{
BigInteger theSeats;
theSeats = this.getSeats();
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "seats", theSeats), currentHashCode, theSeats);
}
{
List<SwedenCountyElectoralArea> theLandstingsvalkrets;
theLandstingsvalkrets = (((this.landstingsvalkrets!= null)&&(!this.landstingsvalkrets.isEmpty()))?this.getLandstingsvalkrets():null);
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "landstingsvalkrets", theLandstingsvalkrets), currentHashCode, theLandstingsvalkrets);
}
return currentHashCode;
}
public int hashCode() {
final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE;
return this.hashCode(null, strategy);
}
}