1
2
3
4
5
6
7
8
9 package com.hack23.cia.model.internal.application.data.party.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
69
70
71
72 @XmlAccessorType(XmlAccessType.FIELD)
73 @XmlType(name = "ViewRiksdagenPartyRoleMember", propOrder = {
74 "roleId",
75 "detail",
76 "roleCode",
77 "firstName",
78 "lastName",
79 "fromDate",
80 "toDate",
81 "personId",
82 "party",
83 "totalDaysServed",
84 "active"
85 })
86 @Entity(name = "ViewRiksdagenPartyRoleMember")
87 @Table(name = "VIEW_RIKSDAGEN_PARTY_ROLE_MEMBER")
88 @Inheritance(strategy = InheritanceType.JOINED)
89 public class ViewRiksdagenPartyRoleMember
90 implements Serializable, ModelObject, Equals, HashCode, ToString
91 {
92
93 private final static long serialVersionUID = 1L;
94 protected long roleId;
95 @XmlElement(required = true)
96 protected String detail;
97 @XmlElement(name = "role_code", required = true)
98 protected String roleCode;
99 @XmlElement(name = "first_name", required = true)
100 protected String firstName;
101 @XmlElement(name = "last_name", required = true)
102 protected String lastName;
103 @XmlElement(name = "from_date", required = true, type = String.class)
104 @XmlJavaTypeAdapter(Adapter3 .class)
105 @XmlSchemaType(name = "date")
106 protected Date fromDate;
107 @XmlElement(name = "to_date", required = true, type = String.class)
108 @XmlJavaTypeAdapter(Adapter3 .class)
109 @XmlSchemaType(name = "date")
110 protected Date toDate;
111 @XmlElement(name = "person_id", required = true)
112 protected String personId;
113 @XmlElement(required = true)
114 protected String party;
115 @XmlElement(name = "total_days_served")
116 protected int totalDaysServed;
117 protected boolean active;
118
119
120
121
122
123 @Id
124 @Column(name = "ROLE_ID")
125 public long getRoleId() {
126 return roleId;
127 }
128
129
130
131
132
133 public void setRoleId(long value) {
134 this.roleId = value;
135 }
136
137
138
139
140
141
142
143
144
145 @Basic
146 @Column(name = "DETAIL", length = 255)
147 public String getDetail() {
148 return detail;
149 }
150
151
152
153
154
155
156
157
158
159 public void setDetail(String value) {
160 this.detail = value;
161 }
162
163
164
165
166
167
168
169
170
171 @Basic
172 @Column(name = "ROLE_CODE", length = 255)
173 public String getRoleCode() {
174 return roleCode;
175 }
176
177
178
179
180
181
182
183
184
185 public void setRoleCode(String value) {
186 this.roleCode = value;
187 }
188
189
190
191
192
193
194
195
196
197 @Basic
198 @Column(name = "FIRST_NAME", length = 255)
199 public String getFirstName() {
200 return firstName;
201 }
202
203
204
205
206
207
208
209
210
211 public void setFirstName(String value) {
212 this.firstName = value;
213 }
214
215
216
217
218
219
220
221
222
223 @Basic
224 @Column(name = "LAST_NAME", length = 255)
225 public String getLastName() {
226 return lastName;
227 }
228
229
230
231
232
233
234
235
236
237 public void setLastName(String value) {
238 this.lastName = value;
239 }
240
241
242
243
244
245
246
247
248
249 @Basic
250 @Column(name = "FROM_DATE")
251 @Temporal(TemporalType.DATE)
252 public Date getFromDate() {
253 return fromDate;
254 }
255
256
257
258
259
260
261
262
263
264 public void setFromDate(Date value) {
265 this.fromDate = value;
266 }
267
268
269
270
271
272
273
274
275
276 @Basic
277 @Column(name = "TO_DATE")
278 @Temporal(TemporalType.DATE)
279 public Date getToDate() {
280 return toDate;
281 }
282
283
284
285
286
287
288
289
290
291 public void setToDate(Date value) {
292 this.toDate = value;
293 }
294
295
296
297
298
299
300
301
302
303 @Basic
304 @Column(name = "PERSON_ID", length = 255)
305 public String getPersonId() {
306 return personId;
307 }
308
309
310
311
312
313
314
315
316
317 public void setPersonId(String value) {
318 this.personId = value;
319 }
320
321
322
323
324
325
326
327
328
329 @Basic
330 @Column(name = "PARTY", length = 255)
331 public String getParty() {
332 return party;
333 }
334
335
336
337
338
339
340
341
342
343 public void setParty(String value) {
344 this.party = value;
345 }
346
347
348
349
350
351 @Basic
352 @Column(name = "TOTAL_DAYS_SERVED", precision = 10, scale = 0)
353 public int getTotalDaysServed() {
354 return totalDaysServed;
355 }
356
357
358
359
360
361 public void setTotalDaysServed(int value) {
362 this.totalDaysServed = value;
363 }
364
365
366
367
368
369 @Basic
370 @Column(name = "ACTIVE")
371 public boolean isActive() {
372 return active;
373 }
374
375
376
377
378
379 public void setActive(boolean value) {
380 this.active = value;
381 }
382
383 public ViewRiksdagenPartyRoleMember withRoleId(long value) {
384 setRoleId(value);
385 return this;
386 }
387
388 public ViewRiksdagenPartyRoleMember withDetail(String value) {
389 setDetail(value);
390 return this;
391 }
392
393 public ViewRiksdagenPartyRoleMember withRoleCode(String value) {
394 setRoleCode(value);
395 return this;
396 }
397
398 public ViewRiksdagenPartyRoleMember withFirstName(String value) {
399 setFirstName(value);
400 return this;
401 }
402
403 public ViewRiksdagenPartyRoleMember withLastName(String value) {
404 setLastName(value);
405 return this;
406 }
407
408 public ViewRiksdagenPartyRoleMember withFromDate(Date value) {
409 setFromDate(value);
410 return this;
411 }
412
413 public ViewRiksdagenPartyRoleMember withToDate(Date value) {
414 setToDate(value);
415 return this;
416 }
417
418 public ViewRiksdagenPartyRoleMember withPersonId(String value) {
419 setPersonId(value);
420 return this;
421 }
422
423 public ViewRiksdagenPartyRoleMember withParty(String value) {
424 setParty(value);
425 return this;
426 }
427
428 public ViewRiksdagenPartyRoleMember withTotalDaysServed(int value) {
429 setTotalDaysServed(value);
430 return this;
431 }
432
433 public ViewRiksdagenPartyRoleMember withActive(boolean value) {
434 setActive(value);
435 return this;
436 }
437
438 public String toString() {
439 final ToStringStrategy strategy = JAXBToStringStrategy.INSTANCE;
440 final StringBuilder buffer = new StringBuilder();
441 append(null, buffer, strategy);
442 return buffer.toString();
443 }
444
445 public StringBuilder append(ObjectLocator locator, StringBuilder buffer, ToStringStrategy strategy) {
446 strategy.appendStart(locator, this, buffer);
447 appendFields(locator, buffer, strategy);
448 strategy.appendEnd(locator, this, buffer);
449 return buffer;
450 }
451
452 public StringBuilder appendFields(ObjectLocator locator, StringBuilder buffer, ToStringStrategy strategy) {
453 {
454 long theRoleId;
455 theRoleId = this.getRoleId();
456 strategy.appendField(locator, this, "roleId", buffer, theRoleId);
457 }
458 {
459 String theDetail;
460 theDetail = this.getDetail();
461 strategy.appendField(locator, this, "detail", buffer, theDetail);
462 }
463 {
464 String theRoleCode;
465 theRoleCode = this.getRoleCode();
466 strategy.appendField(locator, this, "roleCode", buffer, theRoleCode);
467 }
468 {
469 String theFirstName;
470 theFirstName = this.getFirstName();
471 strategy.appendField(locator, this, "firstName", buffer, theFirstName);
472 }
473 {
474 String theLastName;
475 theLastName = this.getLastName();
476 strategy.appendField(locator, this, "lastName", buffer, theLastName);
477 }
478 {
479 Date theFromDate;
480 theFromDate = this.getFromDate();
481 strategy.appendField(locator, this, "fromDate", buffer, theFromDate);
482 }
483 {
484 Date theToDate;
485 theToDate = this.getToDate();
486 strategy.appendField(locator, this, "toDate", buffer, theToDate);
487 }
488 {
489 String thePersonId;
490 thePersonId = this.getPersonId();
491 strategy.appendField(locator, this, "personId", buffer, thePersonId);
492 }
493 {
494 String theParty;
495 theParty = this.getParty();
496 strategy.appendField(locator, this, "party", buffer, theParty);
497 }
498 {
499 int theTotalDaysServed;
500 theTotalDaysServed = this.getTotalDaysServed();
501 strategy.appendField(locator, this, "totalDaysServed", buffer, theTotalDaysServed);
502 }
503 {
504 boolean theActive;
505 theActive = this.isActive();
506 strategy.appendField(locator, this, "active", buffer, theActive);
507 }
508 return buffer;
509 }
510
511 public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) {
512 if ((object == null)||(this.getClass()!= object.getClass())) {
513 return false;
514 }
515 if (this == object) {
516 return true;
517 }
518 final ViewRiksdagenPartyRoleMember that = ((ViewRiksdagenPartyRoleMember) object);
519 {
520 long lhsRoleId;
521 lhsRoleId = this.getRoleId();
522 long rhsRoleId;
523 rhsRoleId = that.getRoleId();
524 if (!strategy.equals(LocatorUtils.property(thisLocator, "roleId", lhsRoleId), LocatorUtils.property(thatLocator, "roleId", rhsRoleId), lhsRoleId, rhsRoleId)) {
525 return false;
526 }
527 }
528 {
529 String lhsDetail;
530 lhsDetail = this.getDetail();
531 String rhsDetail;
532 rhsDetail = that.getDetail();
533 if (!strategy.equals(LocatorUtils.property(thisLocator, "detail", lhsDetail), LocatorUtils.property(thatLocator, "detail", rhsDetail), lhsDetail, rhsDetail)) {
534 return false;
535 }
536 }
537 {
538 String lhsRoleCode;
539 lhsRoleCode = this.getRoleCode();
540 String rhsRoleCode;
541 rhsRoleCode = that.getRoleCode();
542 if (!strategy.equals(LocatorUtils.property(thisLocator, "roleCode", lhsRoleCode), LocatorUtils.property(thatLocator, "roleCode", rhsRoleCode), lhsRoleCode, rhsRoleCode)) {
543 return false;
544 }
545 }
546 {
547 String lhsFirstName;
548 lhsFirstName = this.getFirstName();
549 String rhsFirstName;
550 rhsFirstName = that.getFirstName();
551 if (!strategy.equals(LocatorUtils.property(thisLocator, "firstName", lhsFirstName), LocatorUtils.property(thatLocator, "firstName", rhsFirstName), lhsFirstName, rhsFirstName)) {
552 return false;
553 }
554 }
555 {
556 String lhsLastName;
557 lhsLastName = this.getLastName();
558 String rhsLastName;
559 rhsLastName = that.getLastName();
560 if (!strategy.equals(LocatorUtils.property(thisLocator, "lastName", lhsLastName), LocatorUtils.property(thatLocator, "lastName", rhsLastName), lhsLastName, rhsLastName)) {
561 return false;
562 }
563 }
564 {
565 Date lhsFromDate;
566 lhsFromDate = this.getFromDate();
567 Date rhsFromDate;
568 rhsFromDate = that.getFromDate();
569 if (!strategy.equals(LocatorUtils.property(thisLocator, "fromDate", lhsFromDate), LocatorUtils.property(thatLocator, "fromDate", rhsFromDate), lhsFromDate, rhsFromDate)) {
570 return false;
571 }
572 }
573 {
574 Date lhsToDate;
575 lhsToDate = this.getToDate();
576 Date rhsToDate;
577 rhsToDate = that.getToDate();
578 if (!strategy.equals(LocatorUtils.property(thisLocator, "toDate", lhsToDate), LocatorUtils.property(thatLocator, "toDate", rhsToDate), lhsToDate, rhsToDate)) {
579 return false;
580 }
581 }
582 {
583 String lhsPersonId;
584 lhsPersonId = this.getPersonId();
585 String rhsPersonId;
586 rhsPersonId = that.getPersonId();
587 if (!strategy.equals(LocatorUtils.property(thisLocator, "personId", lhsPersonId), LocatorUtils.property(thatLocator, "personId", rhsPersonId), lhsPersonId, rhsPersonId)) {
588 return false;
589 }
590 }
591 {
592 String lhsParty;
593 lhsParty = this.getParty();
594 String rhsParty;
595 rhsParty = that.getParty();
596 if (!strategy.equals(LocatorUtils.property(thisLocator, "party", lhsParty), LocatorUtils.property(thatLocator, "party", rhsParty), lhsParty, rhsParty)) {
597 return false;
598 }
599 }
600 {
601 int lhsTotalDaysServed;
602 lhsTotalDaysServed = this.getTotalDaysServed();
603 int rhsTotalDaysServed;
604 rhsTotalDaysServed = that.getTotalDaysServed();
605 if (!strategy.equals(LocatorUtils.property(thisLocator, "totalDaysServed", lhsTotalDaysServed), LocatorUtils.property(thatLocator, "totalDaysServed", rhsTotalDaysServed), lhsTotalDaysServed, rhsTotalDaysServed)) {
606 return false;
607 }
608 }
609 {
610 boolean lhsActive;
611 lhsActive = this.isActive();
612 boolean rhsActive;
613 rhsActive = that.isActive();
614 if (!strategy.equals(LocatorUtils.property(thisLocator, "active", lhsActive), LocatorUtils.property(thatLocator, "active", rhsActive), lhsActive, rhsActive)) {
615 return false;
616 }
617 }
618 return true;
619 }
620
621 public boolean equals(Object object) {
622 final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE;
623 return equals(null, null, object, strategy);
624 }
625
626 public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) {
627 int currentHashCode = 1;
628 {
629 long theRoleId;
630 theRoleId = this.getRoleId();
631 currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "roleId", theRoleId), currentHashCode, theRoleId);
632 }
633 {
634 String theDetail;
635 theDetail = this.getDetail();
636 currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "detail", theDetail), currentHashCode, theDetail);
637 }
638 {
639 String theRoleCode;
640 theRoleCode = this.getRoleCode();
641 currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "roleCode", theRoleCode), currentHashCode, theRoleCode);
642 }
643 {
644 String theFirstName;
645 theFirstName = this.getFirstName();
646 currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "firstName", theFirstName), currentHashCode, theFirstName);
647 }
648 {
649 String theLastName;
650 theLastName = this.getLastName();
651 currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "lastName", theLastName), currentHashCode, theLastName);
652 }
653 {
654 Date theFromDate;
655 theFromDate = this.getFromDate();
656 currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "fromDate", theFromDate), currentHashCode, theFromDate);
657 }
658 {
659 Date theToDate;
660 theToDate = this.getToDate();
661 currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "toDate", theToDate), currentHashCode, theToDate);
662 }
663 {
664 String thePersonId;
665 thePersonId = this.getPersonId();
666 currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "personId", thePersonId), currentHashCode, thePersonId);
667 }
668 {
669 String theParty;
670 theParty = this.getParty();
671 currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "party", theParty), currentHashCode, theParty);
672 }
673 {
674 int theTotalDaysServed;
675 theTotalDaysServed = this.getTotalDaysServed();
676 currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "totalDaysServed", theTotalDaysServed), currentHashCode, theTotalDaysServed);
677 }
678 {
679 boolean theActive;
680 theActive = this.isActive();
681 currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "active", theActive), currentHashCode, theActive);
682 }
683 return currentHashCode;
684 }
685
686 public int hashCode() {
687 final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE;
688 return this.hashCode(null, strategy);
689 }
690
691 }