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:42 PM CEST 
6   //
7   
8   
9   package com.hack23.cia.model.external.val.partier.impl;
10  
11  import java.io.Serializable;
12  import java.util.ArrayList;
13  import java.util.List;
14  import javax.persistence.Basic;
15  import javax.persistence.CascadeType;
16  import javax.persistence.Column;
17  import javax.persistence.Entity;
18  import javax.persistence.GeneratedValue;
19  import javax.persistence.GenerationType;
20  import javax.persistence.Id;
21  import javax.persistence.Inheritance;
22  import javax.persistence.InheritanceType;
23  import javax.persistence.JoinColumn;
24  import javax.persistence.OneToMany;
25  import javax.persistence.Table;
26  import javax.xml.bind.annotation.XmlAccessType;
27  import javax.xml.bind.annotation.XmlAccessorType;
28  import javax.xml.bind.annotation.XmlAttribute;
29  import javax.xml.bind.annotation.XmlElement;
30  import javax.xml.bind.annotation.XmlType;
31  import com.hack23.cia.model.common.api.ModelObject;
32  import org.jvnet.jaxb2_commons.lang.Equals;
33  import org.jvnet.jaxb2_commons.lang.EqualsStrategy;
34  import org.jvnet.jaxb2_commons.lang.HashCode;
35  import org.jvnet.jaxb2_commons.lang.HashCodeStrategy;
36  import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy;
37  import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy;
38  import org.jvnet.jaxb2_commons.locator.ObjectLocator;
39  import org.jvnet.jaxb2_commons.locator.util.LocatorUtils;
40  
41  
42  /**
43   * <p>Java class for SwedenElectionRegion complex type.
44   * 
45   * <p>The following schema fragment specifies the expected content contained within this class.
46   * 
47   * <pre>
48   * &lt;complexType name="SwedenElectionRegion"&gt;
49   *   &lt;complexContent&gt;
50   *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
51   *       &lt;sequence&gt;
52   *         &lt;element name="lan_id" type="{http://www.w3.org/2001/XMLSchema}string"/&gt;
53   *         &lt;element name="kommun_id" type="{http://www.w3.org/2001/XMLSchema}string"/&gt;
54   *         &lt;element name="namn" type="{http://www.w3.org/2001/XMLSchema}string"/&gt;
55   *         &lt;element name="parti" type="{http://partier.val.external.model.cia.hack23.com/impl}SwedenPoliticalParty" maxOccurs="unbounded"/&gt;
56   *       &lt;/sequence&gt;
57   *     &lt;/restriction&gt;
58   *   &lt;/complexContent&gt;
59   * &lt;/complexType&gt;
60   * </pre>
61   * 
62   * 
63   */
64  @XmlAccessorType(XmlAccessType.FIELD)
65  @XmlType(name = "SwedenElectionRegion", propOrder = {
66      "countyId",
67      "municipalId",
68      "regionName",
69      "parties"
70  })
71  @Entity(name = "SwedenElectionRegion")
72  @Table(name = "SWEDEN_ELECTION_REGION")
73  @Inheritance(strategy = InheritanceType.JOINED)
74  public class SwedenElectionRegion
75      implements Serializable, ModelObject, Equals, HashCode
76  {
77  
78      @XmlElement(name = "lan_id", required = true)
79      protected String countyId;
80      @XmlElement(name = "kommun_id", required = true)
81      protected String municipalId;
82      @XmlElement(name = "namn", required = true)
83      protected String regionName;
84      @XmlElement(name = "parti", required = true)
85      protected List<SwedenPoliticalParty> parties;
86      @XmlAttribute(name = "Hjid")
87      protected Long hjid;
88  
89      /**
90       * Gets the value of the countyId property.
91       * 
92       * @return
93       *     possible object is
94       *     {@link String }
95       *     
96       */
97      @Basic
98      @Column(name = "COUNTY_ID", length = 255)
99      public String getCountyId() {
100         return countyId;
101     }
102 
103     /**
104      * Sets the value of the countyId property.
105      * 
106      * @param value
107      *     allowed object is
108      *     {@link String }
109      *     
110      */
111     public void setCountyId(String value) {
112         this.countyId = value;
113     }
114 
115     /**
116      * Gets the value of the municipalId property.
117      * 
118      * @return
119      *     possible object is
120      *     {@link String }
121      *     
122      */
123     @Basic
124     @Column(name = "MUNICIPAL_ID", length = 255)
125     public String getMunicipalId() {
126         return municipalId;
127     }
128 
129     /**
130      * Sets the value of the municipalId property.
131      * 
132      * @param value
133      *     allowed object is
134      *     {@link String }
135      *     
136      */
137     public void setMunicipalId(String value) {
138         this.municipalId = value;
139     }
140 
141     /**
142      * Gets the value of the regionName property.
143      * 
144      * @return
145      *     possible object is
146      *     {@link String }
147      *     
148      */
149     @Basic
150     @Column(name = "REGION_NAME", length = 255)
151     public String getRegionName() {
152         return regionName;
153     }
154 
155     /**
156      * Sets the value of the regionName property.
157      * 
158      * @param value
159      *     allowed object is
160      *     {@link String }
161      *     
162      */
163     public void setRegionName(String value) {
164         this.regionName = value;
165     }
166 
167     /**
168      * Gets the value of the parties property.
169      * 
170      * <p>
171      * This accessor method returns a reference to the live list,
172      * not a snapshot. Therefore any modification you make to the
173      * returned list will be present inside the JAXB object.
174      * This is why there is not a <CODE>set</CODE> method for the parties property.
175      * 
176      * <p>
177      * For example, to add a new item, do as follows:
178      * <pre>
179      *    getParties().add(newItem);
180      * </pre>
181      * 
182      * 
183      * <p>
184      * Objects of the following type(s) are allowed in the list
185      * {@link SwedenPoliticalParty }
186      * 
187      * 
188      */
189     @OneToMany(targetEntity = SwedenPoliticalParty.class, cascade = {
190         CascadeType.ALL
191     })
192     @JoinColumn(name = "PARTIES_SWEDEN_ELECTION_REGI_0")
193     public List<SwedenPoliticalParty> getParties() {
194         if (parties == null) {
195             parties = new ArrayList<SwedenPoliticalParty>();
196         }
197         return this.parties;
198     }
199 
200     /**
201      * 
202      * 
203      */
204     public void setParties(List<SwedenPoliticalParty> parties) {
205         this.parties = parties;
206     }
207 
208     /**
209      * Gets the value of the hjid property.
210      * 
211      * @return
212      *     possible object is
213      *     {@link Long }
214      *     
215      */
216     @Id
217     @Column(name = "HJID")
218     @GeneratedValue(strategy = GenerationType.AUTO)
219     public Long getHjid() {
220         return hjid;
221     }
222 
223     /**
224      * Sets the value of the hjid property.
225      * 
226      * @param value
227      *     allowed object is
228      *     {@link Long }
229      *     
230      */
231     public void setHjid(Long value) {
232         this.hjid = value;
233     }
234 
235     public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) {
236         if ((object == null)||(this.getClass()!= object.getClass())) {
237             return false;
238         }
239         if (this == object) {
240             return true;
241         }
242         final SwedenElectionRegion that = ((SwedenElectionRegion) object);
243         {
244             String lhsCountyId;
245             lhsCountyId = this.getCountyId();
246             String rhsCountyId;
247             rhsCountyId = that.getCountyId();
248             if (!strategy.equals(LocatorUtils.property(thisLocator, "countyId", lhsCountyId), LocatorUtils.property(thatLocator, "countyId", rhsCountyId), lhsCountyId, rhsCountyId)) {
249                 return false;
250             }
251         }
252         {
253             String lhsMunicipalId;
254             lhsMunicipalId = this.getMunicipalId();
255             String rhsMunicipalId;
256             rhsMunicipalId = that.getMunicipalId();
257             if (!strategy.equals(LocatorUtils.property(thisLocator, "municipalId", lhsMunicipalId), LocatorUtils.property(thatLocator, "municipalId", rhsMunicipalId), lhsMunicipalId, rhsMunicipalId)) {
258                 return false;
259             }
260         }
261         {
262             String lhsRegionName;
263             lhsRegionName = this.getRegionName();
264             String rhsRegionName;
265             rhsRegionName = that.getRegionName();
266             if (!strategy.equals(LocatorUtils.property(thisLocator, "regionName", lhsRegionName), LocatorUtils.property(thatLocator, "regionName", rhsRegionName), lhsRegionName, rhsRegionName)) {
267                 return false;
268             }
269         }
270         {
271             List<SwedenPoliticalParty> lhsParties;
272             lhsParties = (((this.parties!= null)&&(!this.parties.isEmpty()))?this.getParties():null);
273             List<SwedenPoliticalParty> rhsParties;
274             rhsParties = (((that.parties!= null)&&(!that.parties.isEmpty()))?that.getParties():null);
275             if (!strategy.equals(LocatorUtils.property(thisLocator, "parties", lhsParties), LocatorUtils.property(thatLocator, "parties", rhsParties), lhsParties, rhsParties)) {
276                 return false;
277             }
278         }
279         return true;
280     }
281 
282     public boolean equals(Object object) {
283         final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE;
284         return equals(null, null, object, strategy);
285     }
286 
287     public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) {
288         int currentHashCode = 1;
289         {
290             String theCountyId;
291             theCountyId = this.getCountyId();
292             currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "countyId", theCountyId), currentHashCode, theCountyId);
293         }
294         {
295             String theMunicipalId;
296             theMunicipalId = this.getMunicipalId();
297             currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "municipalId", theMunicipalId), currentHashCode, theMunicipalId);
298         }
299         {
300             String theRegionName;
301             theRegionName = this.getRegionName();
302             currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "regionName", theRegionName), currentHashCode, theRegionName);
303         }
304         {
305             List<SwedenPoliticalParty> theParties;
306             theParties = (((this.parties!= null)&&(!this.parties.isEmpty()))?this.getParties():null);
307             currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "parties", theParties), currentHashCode, theParties);
308         }
309         return currentHashCode;
310     }
311 
312     public int hashCode() {
313         final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE;
314         return this.hashCode(null, strategy);
315     }
316 
317 }