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:58 PM CEST 
6   //
7   
8   
9   package com.hack23.cia.model.external.riksdagen.votering.impl;
10  
11  import java.io.Serializable;
12  import javax.persistence.CascadeType;
13  import javax.persistence.Column;
14  import javax.persistence.Entity;
15  import javax.persistence.GeneratedValue;
16  import javax.persistence.GenerationType;
17  import javax.persistence.Id;
18  import javax.persistence.Inheritance;
19  import javax.persistence.InheritanceType;
20  import javax.persistence.JoinColumn;
21  import javax.persistence.ManyToOne;
22  import javax.persistence.Table;
23  import javax.xml.bind.annotation.XmlAccessType;
24  import javax.xml.bind.annotation.XmlAccessorType;
25  import javax.xml.bind.annotation.XmlAttribute;
26  import javax.xml.bind.annotation.XmlElement;
27  import javax.xml.bind.annotation.XmlType;
28  import com.hack23.cia.model.common.api.ModelObject;
29  import org.jvnet.jaxb2_commons.lang.Equals;
30  import org.jvnet.jaxb2_commons.lang.EqualsStrategy;
31  import org.jvnet.jaxb2_commons.lang.HashCode;
32  import org.jvnet.jaxb2_commons.lang.HashCodeStrategy;
33  import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy;
34  import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy;
35  import org.jvnet.jaxb2_commons.lang.JAXBToStringStrategy;
36  import org.jvnet.jaxb2_commons.lang.ToString;
37  import org.jvnet.jaxb2_commons.lang.ToStringStrategy;
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 BallotContainer complex type.
44   * 
45   * <p>The following schema fragment specifies the expected content contained within this class.
46   * 
47   * <pre>
48   * &lt;complexType name="BallotContainer"&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="dokvotering" type="{http://votering.riksdagen.external.model.cia.hack23.com/impl}BallotDocumentData"/&gt;
53   *         &lt;element name="dokument" type="{http://votering.riksdagen.external.model.cia.hack23.com/impl}BallotDocumentElement"/&gt;
54   *       &lt;/sequence&gt;
55   *     &lt;/restriction&gt;
56   *   &lt;/complexContent&gt;
57   * &lt;/complexType&gt;
58   * </pre>
59   * 
60   * 
61   */
62  @XmlAccessorType(XmlAccessType.FIELD)
63  @XmlType(name = "BallotContainer", propOrder = {
64      "ballotDocumentData",
65      "ballotDocumentElement"
66  })
67  @Entity(name = "BallotContainer")
68  @Table(name = "BALLOT_CONTAINER")
69  @Inheritance(strategy = InheritanceType.JOINED)
70  public class BallotContainer
71      implements Serializable, ModelObject, Equals, HashCode, ToString
72  {
73  
74      @XmlElement(name = "dokvotering", required = true)
75      protected BallotDocumentData ballotDocumentData;
76      @XmlElement(name = "dokument", required = true)
77      protected BallotDocumentElement ballotDocumentElement;
78      @XmlAttribute(name = "Hjid")
79      protected Long hjid;
80  
81      /**
82       * Gets the value of the ballotDocumentData property.
83       * 
84       * @return
85       *     possible object is
86       *     {@link BallotDocumentData }
87       *     
88       */
89      @ManyToOne(targetEntity = BallotDocumentData.class, cascade = {
90          CascadeType.ALL
91      })
92      @JoinColumn(name = "BALLOT_DOCUMENT_DATA_BALLOT__0")
93      public BallotDocumentData getBallotDocumentData() {
94          return ballotDocumentData;
95      }
96  
97      /**
98       * Sets the value of the ballotDocumentData property.
99       * 
100      * @param value
101      *     allowed object is
102      *     {@link BallotDocumentData }
103      *     
104      */
105     public void setBallotDocumentData(BallotDocumentData value) {
106         this.ballotDocumentData = value;
107     }
108 
109     /**
110      * Gets the value of the ballotDocumentElement property.
111      * 
112      * @return
113      *     possible object is
114      *     {@link BallotDocumentElement }
115      *     
116      */
117     @ManyToOne(targetEntity = BallotDocumentElement.class, cascade = {
118         CascadeType.ALL
119     })
120     @JoinColumn(name = "BALLOT_DOCUMENT_ELEMENT_BALL_0")
121     public BallotDocumentElement getBallotDocumentElement() {
122         return ballotDocumentElement;
123     }
124 
125     /**
126      * Sets the value of the ballotDocumentElement property.
127      * 
128      * @param value
129      *     allowed object is
130      *     {@link BallotDocumentElement }
131      *     
132      */
133     public void setBallotDocumentElement(BallotDocumentElement value) {
134         this.ballotDocumentElement = value;
135     }
136 
137     public BallotContainer withBallotDocumentData(BallotDocumentData value) {
138         setBallotDocumentData(value);
139         return this;
140     }
141 
142     public BallotContainer withBallotDocumentElement(BallotDocumentElement value) {
143         setBallotDocumentElement(value);
144         return this;
145     }
146 
147     public String toString() {
148         final ToStringStrategy strategy = JAXBToStringStrategy.INSTANCE;
149         final StringBuilder buffer = new StringBuilder();
150         append(null, buffer, strategy);
151         return buffer.toString();
152     }
153 
154     public StringBuilder append(ObjectLocator locator, StringBuilder buffer, ToStringStrategy strategy) {
155         strategy.appendStart(locator, this, buffer);
156         appendFields(locator, buffer, strategy);
157         strategy.appendEnd(locator, this, buffer);
158         return buffer;
159     }
160 
161     public StringBuilder appendFields(ObjectLocator locator, StringBuilder buffer, ToStringStrategy strategy) {
162         {
163             BallotDocumentData theBallotDocumentData;
164             theBallotDocumentData = this.getBallotDocumentData();
165             strategy.appendField(locator, this, "ballotDocumentData", buffer, theBallotDocumentData);
166         }
167         {
168             BallotDocumentElement theBallotDocumentElement;
169             theBallotDocumentElement = this.getBallotDocumentElement();
170             strategy.appendField(locator, this, "ballotDocumentElement", buffer, theBallotDocumentElement);
171         }
172         return buffer;
173     }
174 
175     /**
176      * Gets the value of the hjid property.
177      * 
178      * @return
179      *     possible object is
180      *     {@link Long }
181      *     
182      */
183     @Id
184     @Column(name = "HJID")
185     @GeneratedValue(strategy = GenerationType.AUTO)
186     public Long getHjid() {
187         return hjid;
188     }
189 
190     /**
191      * Sets the value of the hjid property.
192      * 
193      * @param value
194      *     allowed object is
195      *     {@link Long }
196      *     
197      */
198     public void setHjid(Long value) {
199         this.hjid = value;
200     }
201 
202     public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) {
203         if ((object == null)||(this.getClass()!= object.getClass())) {
204             return false;
205         }
206         if (this == object) {
207             return true;
208         }
209         final BallotContainer that = ((BallotContainer) object);
210         {
211             BallotDocumentData lhsBallotDocumentData;
212             lhsBallotDocumentData = this.getBallotDocumentData();
213             BallotDocumentData rhsBallotDocumentData;
214             rhsBallotDocumentData = that.getBallotDocumentData();
215             if (!strategy.equals(LocatorUtils.property(thisLocator, "ballotDocumentData", lhsBallotDocumentData), LocatorUtils.property(thatLocator, "ballotDocumentData", rhsBallotDocumentData), lhsBallotDocumentData, rhsBallotDocumentData)) {
216                 return false;
217             }
218         }
219         {
220             BallotDocumentElement lhsBallotDocumentElement;
221             lhsBallotDocumentElement = this.getBallotDocumentElement();
222             BallotDocumentElement rhsBallotDocumentElement;
223             rhsBallotDocumentElement = that.getBallotDocumentElement();
224             if (!strategy.equals(LocatorUtils.property(thisLocator, "ballotDocumentElement", lhsBallotDocumentElement), LocatorUtils.property(thatLocator, "ballotDocumentElement", rhsBallotDocumentElement), lhsBallotDocumentElement, rhsBallotDocumentElement)) {
225                 return false;
226             }
227         }
228         return true;
229     }
230 
231     public boolean equals(Object object) {
232         final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE;
233         return equals(null, null, object, strategy);
234     }
235 
236     public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) {
237         int currentHashCode = 1;
238         {
239             BallotDocumentData theBallotDocumentData;
240             theBallotDocumentData = this.getBallotDocumentData();
241             currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "ballotDocumentData", theBallotDocumentData), currentHashCode, theBallotDocumentData);
242         }
243         {
244             BallotDocumentElement theBallotDocumentElement;
245             theBallotDocumentElement = this.getBallotDocumentElement();
246             currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "ballotDocumentElement", theBallotDocumentElement), currentHashCode, theBallotDocumentElement);
247         }
248         return currentHashCode;
249     }
250 
251     public int hashCode() {
252         final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE;
253         return this.hashCode(null, strategy);
254     }
255 
256 }