1
2
3
4
5
6
7
8
9 package com.hack23.cia.model.internal.application.data.ministry.impl;
10
11 import java.io.Serializable;
12 import java.util.Date;
13 import javax.persistence.Basic;
14 import javax.persistence.Column;
15 import javax.persistence.Entity;
16 import javax.persistence.Id;
17 import javax.persistence.Inheritance;
18 import javax.persistence.InheritanceType;
19 import javax.persistence.Table;
20 import javax.persistence.Temporal;
21 import javax.persistence.TemporalType;
22 import javax.xml.bind.annotation.XmlAccessType;
23 import javax.xml.bind.annotation.XmlAccessorType;
24 import javax.xml.bind.annotation.XmlElement;
25 import javax.xml.bind.annotation.XmlSchemaType;
26 import javax.xml.bind.annotation.XmlType;
27 import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
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 import org.w3._2001.xmlschema.Adapter3;
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68 @XmlAccessorType(XmlAccessType.FIELD)
69 @XmlType(name = "ViewRiksdagenMinistry", propOrder = {
70 "nameId",
71 "totalAssignments",
72 "firstAssignmentDate",
73 "lastAssignmentDate",
74 "totalDaysServed",
75 "currentMemberSize",
76 "active"
77 })
78 @Entity(name = "ViewRiksdagenMinistry")
79 @Table(name = "VIEW_RIKSDAGEN_GOVERMENT")
80 @Inheritance(strategy = InheritanceType.JOINED)
81 public class ViewRiksdagenMinistry
82 implements Serializable, ModelObject, Equals, HashCode, ToString
83 {
84
85 private final static long serialVersionUID = 1L;
86 @XmlElement(required = true)
87 protected String nameId;
88 protected long totalAssignments;
89 @XmlElement(required = true, type = String.class)
90 @XmlJavaTypeAdapter(Adapter3 .class)
91 @XmlSchemaType(name = "date")
92 protected Date firstAssignmentDate;
93 @XmlElement(required = true, type = String.class)
94 @XmlJavaTypeAdapter(Adapter3 .class)
95 @XmlSchemaType(name = "date")
96 protected Date lastAssignmentDate;
97 protected long totalDaysServed;
98 protected long currentMemberSize;
99 protected boolean active;
100
101
102
103
104
105
106
107
108
109 @Id
110 @Column(name = "NAME_ID")
111 public String getNameId() {
112 return nameId;
113 }
114
115
116
117
118
119
120
121
122
123 public void setNameId(String value) {
124 this.nameId = value;
125 }
126
127
128
129
130
131 @Basic
132 @Column(name = "TOTAL_ASSIGNMENTS", precision = 20, scale = 0)
133 public long getTotalAssignments() {
134 return totalAssignments;
135 }
136
137
138
139
140
141 public void setTotalAssignments(long value) {
142 this.totalAssignments = value;
143 }
144
145
146
147
148
149
150
151
152
153 @Basic
154 @Column(name = "FIRST_ASSIGNMENT_DATE")
155 @Temporal(TemporalType.DATE)
156 public Date getFirstAssignmentDate() {
157 return firstAssignmentDate;
158 }
159
160
161
162
163
164
165
166
167
168 public void setFirstAssignmentDate(Date value) {
169 this.firstAssignmentDate = value;
170 }
171
172
173
174
175
176
177
178
179
180 @Basic
181 @Column(name = "LAST_ASSIGNMENT_DATE")
182 @Temporal(TemporalType.DATE)
183 public Date getLastAssignmentDate() {
184 return lastAssignmentDate;
185 }
186
187
188
189
190
191
192
193
194
195 public void setLastAssignmentDate(Date value) {
196 this.lastAssignmentDate = value;
197 }
198
199
200
201
202
203 @Basic
204 @Column(name = "TOTAL_DAYS_SERVED", precision = 20, scale = 0)
205 public long getTotalDaysServed() {
206 return totalDaysServed;
207 }
208
209
210
211
212
213 public void setTotalDaysServed(long value) {
214 this.totalDaysServed = value;
215 }
216
217
218
219
220
221 @Basic
222 @Column(name = "CURRENT_MEMBER_SIZE", precision = 20, scale = 0)
223 public long getCurrentMemberSize() {
224 return currentMemberSize;
225 }
226
227
228
229
230
231 public void setCurrentMemberSize(long value) {
232 this.currentMemberSize = value;
233 }
234
235
236
237
238
239 @Basic
240 @Column(name = "ACTIVE")
241 public boolean isActive() {
242 return active;
243 }
244
245
246
247
248
249 public void setActive(boolean value) {
250 this.active = value;
251 }
252
253 public ViewRiksdagenMinistry withNameId(String value) {
254 setNameId(value);
255 return this;
256 }
257
258 public ViewRiksdagenMinistry withTotalAssignments(long value) {
259 setTotalAssignments(value);
260 return this;
261 }
262
263 public ViewRiksdagenMinistry withFirstAssignmentDate(Date value) {
264 setFirstAssignmentDate(value);
265 return this;
266 }
267
268 public ViewRiksdagenMinistry withLastAssignmentDate(Date value) {
269 setLastAssignmentDate(value);
270 return this;
271 }
272
273 public ViewRiksdagenMinistry withTotalDaysServed(long value) {
274 setTotalDaysServed(value);
275 return this;
276 }
277
278 public ViewRiksdagenMinistry withCurrentMemberSize(long value) {
279 setCurrentMemberSize(value);
280 return this;
281 }
282
283 public ViewRiksdagenMinistry withActive(boolean value) {
284 setActive(value);
285 return this;
286 }
287
288 public String toString() {
289 final ToStringStrategy strategy = JAXBToStringStrategy.INSTANCE;
290 final StringBuilder buffer = new StringBuilder();
291 append(null, buffer, strategy);
292 return buffer.toString();
293 }
294
295 public StringBuilder append(ObjectLocator locator, StringBuilder buffer, ToStringStrategy strategy) {
296 strategy.appendStart(locator, this, buffer);
297 appendFields(locator, buffer, strategy);
298 strategy.appendEnd(locator, this, buffer);
299 return buffer;
300 }
301
302 public StringBuilder appendFields(ObjectLocator locator, StringBuilder buffer, ToStringStrategy strategy) {
303 {
304 String theNameId;
305 theNameId = this.getNameId();
306 strategy.appendField(locator, this, "nameId", buffer, theNameId);
307 }
308 {
309 long theTotalAssignments;
310 theTotalAssignments = this.getTotalAssignments();
311 strategy.appendField(locator, this, "totalAssignments", buffer, theTotalAssignments);
312 }
313 {
314 Date theFirstAssignmentDate;
315 theFirstAssignmentDate = this.getFirstAssignmentDate();
316 strategy.appendField(locator, this, "firstAssignmentDate", buffer, theFirstAssignmentDate);
317 }
318 {
319 Date theLastAssignmentDate;
320 theLastAssignmentDate = this.getLastAssignmentDate();
321 strategy.appendField(locator, this, "lastAssignmentDate", buffer, theLastAssignmentDate);
322 }
323 {
324 long theTotalDaysServed;
325 theTotalDaysServed = this.getTotalDaysServed();
326 strategy.appendField(locator, this, "totalDaysServed", buffer, theTotalDaysServed);
327 }
328 {
329 long theCurrentMemberSize;
330 theCurrentMemberSize = this.getCurrentMemberSize();
331 strategy.appendField(locator, this, "currentMemberSize", buffer, theCurrentMemberSize);
332 }
333 {
334 boolean theActive;
335 theActive = this.isActive();
336 strategy.appendField(locator, this, "active", buffer, theActive);
337 }
338 return buffer;
339 }
340
341 public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) {
342 if ((object == null)||(this.getClass()!= object.getClass())) {
343 return false;
344 }
345 if (this == object) {
346 return true;
347 }
348 final ViewRiksdagenMinistry that = ((ViewRiksdagenMinistry) object);
349 {
350 String lhsNameId;
351 lhsNameId = this.getNameId();
352 String rhsNameId;
353 rhsNameId = that.getNameId();
354 if (!strategy.equals(LocatorUtils.property(thisLocator, "nameId", lhsNameId), LocatorUtils.property(thatLocator, "nameId", rhsNameId), lhsNameId, rhsNameId)) {
355 return false;
356 }
357 }
358 {
359 long lhsTotalAssignments;
360 lhsTotalAssignments = this.getTotalAssignments();
361 long rhsTotalAssignments;
362 rhsTotalAssignments = that.getTotalAssignments();
363 if (!strategy.equals(LocatorUtils.property(thisLocator, "totalAssignments", lhsTotalAssignments), LocatorUtils.property(thatLocator, "totalAssignments", rhsTotalAssignments), lhsTotalAssignments, rhsTotalAssignments)) {
364 return false;
365 }
366 }
367 {
368 Date lhsFirstAssignmentDate;
369 lhsFirstAssignmentDate = this.getFirstAssignmentDate();
370 Date rhsFirstAssignmentDate;
371 rhsFirstAssignmentDate = that.getFirstAssignmentDate();
372 if (!strategy.equals(LocatorUtils.property(thisLocator, "firstAssignmentDate", lhsFirstAssignmentDate), LocatorUtils.property(thatLocator, "firstAssignmentDate", rhsFirstAssignmentDate), lhsFirstAssignmentDate, rhsFirstAssignmentDate)) {
373 return false;
374 }
375 }
376 {
377 Date lhsLastAssignmentDate;
378 lhsLastAssignmentDate = this.getLastAssignmentDate();
379 Date rhsLastAssignmentDate;
380 rhsLastAssignmentDate = that.getLastAssignmentDate();
381 if (!strategy.equals(LocatorUtils.property(thisLocator, "lastAssignmentDate", lhsLastAssignmentDate), LocatorUtils.property(thatLocator, "lastAssignmentDate", rhsLastAssignmentDate), lhsLastAssignmentDate, rhsLastAssignmentDate)) {
382 return false;
383 }
384 }
385 {
386 long lhsTotalDaysServed;
387 lhsTotalDaysServed = this.getTotalDaysServed();
388 long rhsTotalDaysServed;
389 rhsTotalDaysServed = that.getTotalDaysServed();
390 if (!strategy.equals(LocatorUtils.property(thisLocator, "totalDaysServed", lhsTotalDaysServed), LocatorUtils.property(thatLocator, "totalDaysServed", rhsTotalDaysServed), lhsTotalDaysServed, rhsTotalDaysServed)) {
391 return false;
392 }
393 }
394 {
395 long lhsCurrentMemberSize;
396 lhsCurrentMemberSize = this.getCurrentMemberSize();
397 long rhsCurrentMemberSize;
398 rhsCurrentMemberSize = that.getCurrentMemberSize();
399 if (!strategy.equals(LocatorUtils.property(thisLocator, "currentMemberSize", lhsCurrentMemberSize), LocatorUtils.property(thatLocator, "currentMemberSize", rhsCurrentMemberSize), lhsCurrentMemberSize, rhsCurrentMemberSize)) {
400 return false;
401 }
402 }
403 {
404 boolean lhsActive;
405 lhsActive = this.isActive();
406 boolean rhsActive;
407 rhsActive = that.isActive();
408 if (!strategy.equals(LocatorUtils.property(thisLocator, "active", lhsActive), LocatorUtils.property(thatLocator, "active", rhsActive), lhsActive, rhsActive)) {
409 return false;
410 }
411 }
412 return true;
413 }
414
415 public boolean equals(Object object) {
416 final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE;
417 return equals(null, null, object, strategy);
418 }
419
420 public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) {
421 int currentHashCode = 1;
422 {
423 String theNameId;
424 theNameId = this.getNameId();
425 currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "nameId", theNameId), currentHashCode, theNameId);
426 }
427 {
428 long theTotalAssignments;
429 theTotalAssignments = this.getTotalAssignments();
430 currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "totalAssignments", theTotalAssignments), currentHashCode, theTotalAssignments);
431 }
432 {
433 Date theFirstAssignmentDate;
434 theFirstAssignmentDate = this.getFirstAssignmentDate();
435 currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "firstAssignmentDate", theFirstAssignmentDate), currentHashCode, theFirstAssignmentDate);
436 }
437 {
438 Date theLastAssignmentDate;
439 theLastAssignmentDate = this.getLastAssignmentDate();
440 currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "lastAssignmentDate", theLastAssignmentDate), currentHashCode, theLastAssignmentDate);
441 }
442 {
443 long theTotalDaysServed;
444 theTotalDaysServed = this.getTotalDaysServed();
445 currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "totalDaysServed", theTotalDaysServed), currentHashCode, theTotalDaysServed);
446 }
447 {
448 long theCurrentMemberSize;
449 theCurrentMemberSize = this.getCurrentMemberSize();
450 currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "currentMemberSize", theCurrentMemberSize), currentHashCode, theCurrentMemberSize);
451 }
452 {
453 boolean theActive;
454 theActive = this.isActive();
455 currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "active", theActive), currentHashCode, theActive);
456 }
457 return currentHashCode;
458 }
459
460 public int hashCode() {
461 final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE;
462 return this.hashCode(null, strategy);
463 }
464
465 }