1
2
3
4
5
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
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
83
84
85
86
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
99
100
101
102
103
104
105 public void setBallotDocumentData(BallotDocumentData value) {
106 this.ballotDocumentData = value;
107 }
108
109
110
111
112
113
114
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
127
128
129
130
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
177
178
179
180
181
182
183 @Id
184 @Column(name = "HJID")
185 @GeneratedValue(strategy = GenerationType.AUTO)
186 public Long getHjid() {
187 return hjid;
188 }
189
190
191
192
193
194
195
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 }