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:22:20 PM CEST 
6   //
7   
8   
9   package com.hack23.cia.model.external.riksdagen.personlista.impl;
10  
11  import java.io.Serializable;
12  import java.util.ArrayList;
13  import java.util.Collection;
14  import java.util.List;
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.lang.JAXBToStringStrategy;
39  import org.jvnet.jaxb2_commons.lang.ToString;
40  import org.jvnet.jaxb2_commons.lang.ToStringStrategy;
41  import org.jvnet.jaxb2_commons.locator.ObjectLocator;
42  import org.jvnet.jaxb2_commons.locator.util.LocatorUtils;
43  
44  
45  /**
46   * <p>Java class for PersonContainerElement complex type.
47   * 
48   * <p>The following schema fragment specifies the expected content contained within this class.
49   * 
50   * <pre>
51   * &lt;complexType name="PersonContainerElement"&gt;
52   *   &lt;complexContent&gt;
53   *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
54   *       &lt;sequence&gt;
55   *         &lt;element name="person" type="{http://personlista.riksdagen.external.model.cia.hack23.com/impl}PersonElement" 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 = "PersonContainerElement", propOrder = {
66      "person"
67  })
68  @Entity(name = "PersonContainerElement")
69  @Table(name = "PERSON_CONTAINER_ELEMENT")
70  @Inheritance(strategy = InheritanceType.JOINED)
71  public class PersonContainerElement
72      implements Serializable, ModelObject, Equals, HashCode, ToString
73  {
74  
75      @XmlElement(required = true)
76      protected List<PersonElement> person;
77      @XmlAttribute(name = "Hjid")
78      protected Long hjid;
79  
80      /**
81       * Gets the value of the person property.
82       * 
83       * <p>
84       * This accessor method returns a reference to the live list,
85       * not a snapshot. Therefore any modification you make to the
86       * returned list will be present inside the JAXB object.
87       * This is why there is not a <CODE>set</CODE> method for the person property.
88       * 
89       * <p>
90       * For example, to add a new item, do as follows:
91       * <pre>
92       *    getPerson().add(newItem);
93       * </pre>
94       * 
95       * 
96       * <p>
97       * Objects of the following type(s) are allowed in the list
98       * {@link PersonElement }
99       * 
100      * 
101      */
102     @OneToMany(targetEntity = PersonElement.class, cascade = {
103         CascadeType.ALL
104     })
105     @JoinColumn(name = "PERSON_PERSON_CONTAINER_ELEM_0")
106     public List<PersonElement> getPerson() {
107         if (person == null) {
108             person = new ArrayList<PersonElement>();
109         }
110         return this.person;
111     }
112 
113     /**
114      * 
115      * 
116      */
117     public void setPerson(List<PersonElement> person) {
118         this.person = person;
119     }
120 
121     public PersonContainerElement withPerson(PersonElement... values) {
122         if (values!= null) {
123             for (PersonElement value: values) {
124                 getPerson().add(value);
125             }
126         }
127         return this;
128     }
129 
130     public PersonContainerElement withPerson(Collection<PersonElement> values) {
131         if (values!= null) {
132             getPerson().addAll(values);
133         }
134         return this;
135     }
136 
137     public PersonContainerElement withPerson(List<PersonElement> person) {
138         setPerson(person);
139         return this;
140     }
141 
142     public String toString() {
143         final ToStringStrategy strategy = JAXBToStringStrategy.INSTANCE;
144         final StringBuilder buffer = new StringBuilder();
145         append(null, buffer, strategy);
146         return buffer.toString();
147     }
148 
149     public StringBuilder append(ObjectLocator locator, StringBuilder buffer, ToStringStrategy strategy) {
150         strategy.appendStart(locator, this, buffer);
151         appendFields(locator, buffer, strategy);
152         strategy.appendEnd(locator, this, buffer);
153         return buffer;
154     }
155 
156     public StringBuilder appendFields(ObjectLocator locator, StringBuilder buffer, ToStringStrategy strategy) {
157         {
158             List<PersonElement> thePerson;
159             thePerson = (((this.person!= null)&&(!this.person.isEmpty()))?this.getPerson():null);
160             strategy.appendField(locator, this, "person", buffer, thePerson);
161         }
162         return buffer;
163     }
164 
165     /**
166      * Gets the value of the hjid property.
167      * 
168      * @return
169      *     possible object is
170      *     {@link Long }
171      *     
172      */
173     @Id
174     @Column(name = "HJID")
175     @GeneratedValue(strategy = GenerationType.AUTO)
176     public Long getHjid() {
177         return hjid;
178     }
179 
180     /**
181      * Sets the value of the hjid property.
182      * 
183      * @param value
184      *     allowed object is
185      *     {@link Long }
186      *     
187      */
188     public void setHjid(Long value) {
189         this.hjid = value;
190     }
191 
192     public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) {
193         if ((object == null)||(this.getClass()!= object.getClass())) {
194             return false;
195         }
196         if (this == object) {
197             return true;
198         }
199         final PersonContainerElement that = ((PersonContainerElement) object);
200         {
201             List<PersonElement> lhsPerson;
202             lhsPerson = (((this.person!= null)&&(!this.person.isEmpty()))?this.getPerson():null);
203             List<PersonElement> rhsPerson;
204             rhsPerson = (((that.person!= null)&&(!that.person.isEmpty()))?that.getPerson():null);
205             if (!strategy.equals(LocatorUtils.property(thisLocator, "person", lhsPerson), LocatorUtils.property(thatLocator, "person", rhsPerson), lhsPerson, rhsPerson)) {
206                 return false;
207             }
208         }
209         return true;
210     }
211 
212     public boolean equals(Object object) {
213         final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE;
214         return equals(null, null, object, strategy);
215     }
216 
217     public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) {
218         int currentHashCode = 1;
219         {
220             List<PersonElement> thePerson;
221             thePerson = (((this.person!= null)&&(!this.person.isEmpty()))?this.getPerson():null);
222             currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "person", thePerson), currentHashCode, thePerson);
223         }
224         return currentHashCode;
225     }
226 
227     public int hashCode() {
228         final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE;
229         return this.hashCode(null, strategy);
230     }
231 
232 }