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:12 PM CEST 
6   //
7   
8   
9   package com.hack23.cia.model.external.riksdagen.person.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 PersonAssignmentData complex type.
47   * 
48   * <p>The following schema fragment specifies the expected content contained within this class.
49   * 
50   * <pre>
51   * &lt;complexType name="PersonAssignmentData"&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="uppdrag" type="{http://person.riksdagen.external.model.cia.hack23.com/impl}AssignmentData" 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 = "PersonAssignmentData", propOrder = {
66      "assignmentList"
67  })
68  @Entity(name = "PersonAssignmentData")
69  @Table(name = "PERSON_ASSIGNMENT_DATA")
70  @Inheritance(strategy = InheritanceType.JOINED)
71  public class PersonAssignmentData
72      implements Serializable, ModelObject, Equals, HashCode, ToString
73  {
74  
75      @XmlElement(name = "uppdrag", required = true)
76      protected List<AssignmentData> assignmentList;
77      @XmlAttribute(name = "Hjid")
78      protected Long hjid;
79  
80      /**
81       * Gets the value of the assignmentList 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 assignmentList property.
88       * 
89       * <p>
90       * For example, to add a new item, do as follows:
91       * <pre>
92       *    getAssignmentList().add(newItem);
93       * </pre>
94       * 
95       * 
96       * <p>
97       * Objects of the following type(s) are allowed in the list
98       * {@link AssignmentData }
99       * 
100      * 
101      */
102     @OneToMany(targetEntity = AssignmentData.class, cascade = {
103         CascadeType.ALL
104     })
105     @JoinColumn(name = "ASSIGNMENT_LIST_PERSON_ASSIG_0")
106     public List<AssignmentData> getAssignmentList() {
107         if (assignmentList == null) {
108             assignmentList = new ArrayList<AssignmentData>();
109         }
110         return this.assignmentList;
111     }
112 
113     /**
114      * 
115      * 
116      */
117     public void setAssignmentList(List<AssignmentData> assignmentList) {
118         this.assignmentList = assignmentList;
119     }
120 
121     public PersonAssignmentData withAssignmentList(AssignmentData... values) {
122         if (values!= null) {
123             for (AssignmentData value: values) {
124                 getAssignmentList().add(value);
125             }
126         }
127         return this;
128     }
129 
130     public PersonAssignmentData withAssignmentList(Collection<AssignmentData> values) {
131         if (values!= null) {
132             getAssignmentList().addAll(values);
133         }
134         return this;
135     }
136 
137     public PersonAssignmentData withAssignmentList(List<AssignmentData> assignmentList) {
138         setAssignmentList(assignmentList);
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<AssignmentData> theAssignmentList;
159             theAssignmentList = (((this.assignmentList!= null)&&(!this.assignmentList.isEmpty()))?this.getAssignmentList():null);
160             strategy.appendField(locator, this, "assignmentList", buffer, theAssignmentList);
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 PersonAssignmentData that = ((PersonAssignmentData) object);
200         {
201             List<AssignmentData> lhsAssignmentList;
202             lhsAssignmentList = (((this.assignmentList!= null)&&(!this.assignmentList.isEmpty()))?this.getAssignmentList():null);
203             List<AssignmentData> rhsAssignmentList;
204             rhsAssignmentList = (((that.assignmentList!= null)&&(!that.assignmentList.isEmpty()))?that.getAssignmentList():null);
205             if (!strategy.equals(LocatorUtils.property(thisLocator, "assignmentList", lhsAssignmentList), LocatorUtils.property(thatLocator, "assignmentList", rhsAssignmentList), lhsAssignmentList, rhsAssignmentList)) {
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<AssignmentData> theAssignmentList;
221             theAssignmentList = (((this.assignmentList!= null)&&(!this.assignmentList.isEmpty()))?this.getAssignmentList():null);
222             currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "assignmentList", theAssignmentList), currentHashCode, theAssignmentList);
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 }