1
2
3
4
5
6
7
8
9 package com.hack23.cia.model.internal.application.system.impl;
10
11 import java.io.Serializable;
12 import java.util.ArrayList;
13 import java.util.Collection;
14 import java.util.Date;
15 import java.util.List;
16 import javax.persistence.Basic;
17 import javax.persistence.CascadeType;
18 import javax.persistence.Column;
19 import javax.persistence.Entity;
20 import javax.persistence.EnumType;
21 import javax.persistence.Enumerated;
22 import javax.persistence.GeneratedValue;
23 import javax.persistence.GenerationType;
24 import javax.persistence.Id;
25 import javax.persistence.Inheritance;
26 import javax.persistence.InheritanceType;
27 import javax.persistence.JoinColumn;
28 import javax.persistence.OneToMany;
29 import javax.persistence.Table;
30 import javax.persistence.Temporal;
31 import javax.persistence.TemporalType;
32 import javax.xml.bind.annotation.XmlAccessType;
33 import javax.xml.bind.annotation.XmlAccessorType;
34 import javax.xml.bind.annotation.XmlAttribute;
35 import javax.xml.bind.annotation.XmlElement;
36 import javax.xml.bind.annotation.XmlSchemaType;
37 import javax.xml.bind.annotation.XmlType;
38 import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
39 import com.hack23.cia.model.common.api.ModelObject;
40 import org.jvnet.jaxb2_commons.lang.Equals;
41 import org.jvnet.jaxb2_commons.lang.EqualsStrategy;
42 import org.jvnet.jaxb2_commons.lang.HashCode;
43 import org.jvnet.jaxb2_commons.lang.HashCodeStrategy;
44 import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy;
45 import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy;
46 import org.jvnet.jaxb2_commons.lang.JAXBToStringStrategy;
47 import org.jvnet.jaxb2_commons.lang.ToString;
48 import org.jvnet.jaxb2_commons.lang.ToStringStrategy;
49 import org.jvnet.jaxb2_commons.locator.ObjectLocator;
50 import org.jvnet.jaxb2_commons.locator.util.LocatorUtils;
51 import org.w3._2001.xmlschema.Adapter1;
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84 @XmlAccessorType(XmlAccessType.FIELD)
85 @XmlType(name = "ApplicationSession", propOrder = {
86 "modelObjectId",
87 "modelObjectVersion",
88 "createdDate",
89 "destroyedDate",
90 "ipInformation",
91 "userAgentInformation",
92 "sessionId",
93 "userId",
94 "locale",
95 "operatingSystem",
96 "sessionType",
97 "events"
98 })
99 @Entity(name = "ApplicationSession")
100 @Table(name = "APPLICATION_SESSION")
101 @Inheritance(strategy = InheritanceType.JOINED)
102 public class ApplicationSession
103 implements Serializable, ModelObject, Equals, HashCode, ToString
104 {
105
106 private final static long serialVersionUID = 1L;
107 protected Integer modelObjectId;
108 protected Integer modelObjectVersion;
109 @XmlElement(type = String.class)
110 @XmlJavaTypeAdapter(Adapter1 .class)
111 @XmlSchemaType(name = "dateTime")
112 protected Date createdDate;
113 @XmlElement(type = String.class)
114 @XmlJavaTypeAdapter(Adapter1 .class)
115 @XmlSchemaType(name = "dateTime")
116 protected Date destroyedDate;
117 protected String ipInformation;
118 protected String userAgentInformation;
119 protected String sessionId;
120 protected String userId;
121 protected String locale;
122 protected String operatingSystem;
123 @XmlSchemaType(name = "string")
124 protected ApplicationSessionType sessionType;
125 @XmlElement(nillable = true)
126 protected List<ApplicationActionEvent> events;
127 @XmlAttribute(name = "Hjid")
128 protected Long hjid;
129
130
131
132
133
134
135
136
137
138 @Basic
139 @Column(name = "MODEL_OBJECT_ID", precision = 10, scale = 0)
140 public Integer getModelObjectId() {
141 return modelObjectId;
142 }
143
144
145
146
147
148
149
150
151
152 public void setModelObjectId(Integer value) {
153 this.modelObjectId = value;
154 }
155
156
157
158
159
160
161
162
163
164 @Basic
165 @Column(name = "MODEL_OBJECT_VERSION", precision = 10, scale = 0)
166 public Integer getModelObjectVersion() {
167 return modelObjectVersion;
168 }
169
170
171
172
173
174
175
176
177
178 public void setModelObjectVersion(Integer value) {
179 this.modelObjectVersion = value;
180 }
181
182
183
184
185
186
187
188
189
190 @Basic
191 @Column(name = "CREATED_DATE")
192 @Temporal(TemporalType.TIMESTAMP)
193 public Date getCreatedDate() {
194 return createdDate;
195 }
196
197
198
199
200
201
202
203
204
205 public void setCreatedDate(Date value) {
206 this.createdDate = value;
207 }
208
209
210
211
212
213
214
215
216
217 @Basic
218 @Column(name = "DESTROYED_DATE")
219 @Temporal(TemporalType.TIMESTAMP)
220 public Date getDestroyedDate() {
221 return destroyedDate;
222 }
223
224
225
226
227
228
229
230
231
232 public void setDestroyedDate(Date value) {
233 this.destroyedDate = value;
234 }
235
236
237
238
239
240
241
242
243
244 @Basic
245 @Column(name = "IP_INFORMATION", length = 255)
246 public String getIpInformation() {
247 return ipInformation;
248 }
249
250
251
252
253
254
255
256
257
258 public void setIpInformation(String value) {
259 this.ipInformation = value;
260 }
261
262
263
264
265
266
267
268
269
270 @Basic
271 @Column(name = "USER_AGENT_INFORMATION", length = 255)
272 public String getUserAgentInformation() {
273 return userAgentInformation;
274 }
275
276
277
278
279
280
281
282
283
284 public void setUserAgentInformation(String value) {
285 this.userAgentInformation = value;
286 }
287
288
289
290
291
292
293
294
295
296 @Basic
297 @Column(name = "SESSION_ID", length = 255)
298 public String getSessionId() {
299 return sessionId;
300 }
301
302
303
304
305
306
307
308
309
310 public void setSessionId(String value) {
311 this.sessionId = value;
312 }
313
314
315
316
317
318
319
320
321
322 @Basic
323 @Column(name = "USER_ID", length = 255)
324 public String getUserId() {
325 return userId;
326 }
327
328
329
330
331
332
333
334
335
336 public void setUserId(String value) {
337 this.userId = value;
338 }
339
340
341
342
343
344
345
346
347
348 @Basic
349 @Column(name = "LOCALE", length = 255)
350 public String getLocale() {
351 return locale;
352 }
353
354
355
356
357
358
359
360
361
362 public void setLocale(String value) {
363 this.locale = value;
364 }
365
366
367
368
369
370
371
372
373
374 @Basic
375 @Column(name = "OPERATING_SYSTEM", length = 255)
376 public String getOperatingSystem() {
377 return operatingSystem;
378 }
379
380
381
382
383
384
385
386
387
388 public void setOperatingSystem(String value) {
389 this.operatingSystem = value;
390 }
391
392
393
394
395
396
397
398
399
400 @Basic
401 @Column(name = "SESSION_TYPE", length = 255)
402 @Enumerated(EnumType.STRING)
403 public ApplicationSessionType getSessionType() {
404 return sessionType;
405 }
406
407
408
409
410
411
412
413
414
415 public void setSessionType(ApplicationSessionType value) {
416 this.sessionType = value;
417 }
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441 @OneToMany(targetEntity = ApplicationActionEvent.class, cascade = {
442 CascadeType.ALL
443 })
444 @JoinColumn(name = "EVENTS_APPLICATION_SESSION_H_0")
445 public List<ApplicationActionEvent> getEvents() {
446 if (events == null) {
447 events = new ArrayList<ApplicationActionEvent>();
448 }
449 return this.events;
450 }
451
452
453
454
455
456 public void setEvents(List<ApplicationActionEvent> events) {
457 this.events = events;
458 }
459
460 public ApplicationSession withModelObjectId(Integer value) {
461 setModelObjectId(value);
462 return this;
463 }
464
465 public ApplicationSession withModelObjectVersion(Integer value) {
466 setModelObjectVersion(value);
467 return this;
468 }
469
470 public ApplicationSession withCreatedDate(Date value) {
471 setCreatedDate(value);
472 return this;
473 }
474
475 public ApplicationSession withDestroyedDate(Date value) {
476 setDestroyedDate(value);
477 return this;
478 }
479
480 public ApplicationSession withIpInformation(String value) {
481 setIpInformation(value);
482 return this;
483 }
484
485 public ApplicationSession withUserAgentInformation(String value) {
486 setUserAgentInformation(value);
487 return this;
488 }
489
490 public ApplicationSession withSessionId(String value) {
491 setSessionId(value);
492 return this;
493 }
494
495 public ApplicationSession withUserId(String value) {
496 setUserId(value);
497 return this;
498 }
499
500 public ApplicationSession withLocale(String value) {
501 setLocale(value);
502 return this;
503 }
504
505 public ApplicationSession withOperatingSystem(String value) {
506 setOperatingSystem(value);
507 return this;
508 }
509
510 public ApplicationSession withSessionType(ApplicationSessionType value) {
511 setSessionType(value);
512 return this;
513 }
514
515 public ApplicationSession withEvents(ApplicationActionEvent... values) {
516 if (values!= null) {
517 for (ApplicationActionEvent value: values) {
518 getEvents().add(value);
519 }
520 }
521 return this;
522 }
523
524 public ApplicationSession withEvents(Collection<ApplicationActionEvent> values) {
525 if (values!= null) {
526 getEvents().addAll(values);
527 }
528 return this;
529 }
530
531 public ApplicationSession withEvents(List<ApplicationActionEvent> events) {
532 setEvents(events);
533 return this;
534 }
535
536 public String toString() {
537 final ToStringStrategy strategy = JAXBToStringStrategy.INSTANCE;
538 final StringBuilder buffer = new StringBuilder();
539 append(null, buffer, strategy);
540 return buffer.toString();
541 }
542
543 public StringBuilder append(ObjectLocator locator, StringBuilder buffer, ToStringStrategy strategy) {
544 strategy.appendStart(locator, this, buffer);
545 appendFields(locator, buffer, strategy);
546 strategy.appendEnd(locator, this, buffer);
547 return buffer;
548 }
549
550 public StringBuilder appendFields(ObjectLocator locator, StringBuilder buffer, ToStringStrategy strategy) {
551 {
552 Integer theModelObjectId;
553 theModelObjectId = this.getModelObjectId();
554 strategy.appendField(locator, this, "modelObjectId", buffer, theModelObjectId);
555 }
556 {
557 Integer theModelObjectVersion;
558 theModelObjectVersion = this.getModelObjectVersion();
559 strategy.appendField(locator, this, "modelObjectVersion", buffer, theModelObjectVersion);
560 }
561 {
562 Date theCreatedDate;
563 theCreatedDate = this.getCreatedDate();
564 strategy.appendField(locator, this, "createdDate", buffer, theCreatedDate);
565 }
566 {
567 Date theDestroyedDate;
568 theDestroyedDate = this.getDestroyedDate();
569 strategy.appendField(locator, this, "destroyedDate", buffer, theDestroyedDate);
570 }
571 {
572 String theIpInformation;
573 theIpInformation = this.getIpInformation();
574 strategy.appendField(locator, this, "ipInformation", buffer, theIpInformation);
575 }
576 {
577 String theUserAgentInformation;
578 theUserAgentInformation = this.getUserAgentInformation();
579 strategy.appendField(locator, this, "userAgentInformation", buffer, theUserAgentInformation);
580 }
581 {
582 String theSessionId;
583 theSessionId = this.getSessionId();
584 strategy.appendField(locator, this, "sessionId", buffer, theSessionId);
585 }
586 {
587 String theUserId;
588 theUserId = this.getUserId();
589 strategy.appendField(locator, this, "userId", buffer, theUserId);
590 }
591 {
592 String theLocale;
593 theLocale = this.getLocale();
594 strategy.appendField(locator, this, "locale", buffer, theLocale);
595 }
596 {
597 String theOperatingSystem;
598 theOperatingSystem = this.getOperatingSystem();
599 strategy.appendField(locator, this, "operatingSystem", buffer, theOperatingSystem);
600 }
601 {
602 ApplicationSessionType theSessionType;
603 theSessionType = this.getSessionType();
604 strategy.appendField(locator, this, "sessionType", buffer, theSessionType);
605 }
606 {
607 List<ApplicationActionEvent> theEvents;
608 theEvents = (((this.events!= null)&&(!this.events.isEmpty()))?this.getEvents():null);
609 strategy.appendField(locator, this, "events", buffer, theEvents);
610 }
611 return buffer;
612 }
613
614
615
616
617
618
619
620
621
622 @Id
623 @Column(name = "HJID")
624 @GeneratedValue(strategy = GenerationType.AUTO)
625 public Long getHjid() {
626 return hjid;
627 }
628
629
630
631
632
633
634
635
636
637 public void setHjid(Long value) {
638 this.hjid = value;
639 }
640
641 public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) {
642 if ((object == null)||(this.getClass()!= object.getClass())) {
643 return false;
644 }
645 if (this == object) {
646 return true;
647 }
648 final ApplicationSession that = ((ApplicationSession) object);
649 {
650 Integer lhsModelObjectId;
651 lhsModelObjectId = this.getModelObjectId();
652 Integer rhsModelObjectId;
653 rhsModelObjectId = that.getModelObjectId();
654 if (!strategy.equals(LocatorUtils.property(thisLocator, "modelObjectId", lhsModelObjectId), LocatorUtils.property(thatLocator, "modelObjectId", rhsModelObjectId), lhsModelObjectId, rhsModelObjectId)) {
655 return false;
656 }
657 }
658 {
659 Integer lhsModelObjectVersion;
660 lhsModelObjectVersion = this.getModelObjectVersion();
661 Integer rhsModelObjectVersion;
662 rhsModelObjectVersion = that.getModelObjectVersion();
663 if (!strategy.equals(LocatorUtils.property(thisLocator, "modelObjectVersion", lhsModelObjectVersion), LocatorUtils.property(thatLocator, "modelObjectVersion", rhsModelObjectVersion), lhsModelObjectVersion, rhsModelObjectVersion)) {
664 return false;
665 }
666 }
667 {
668 Date lhsCreatedDate;
669 lhsCreatedDate = this.getCreatedDate();
670 Date rhsCreatedDate;
671 rhsCreatedDate = that.getCreatedDate();
672 if (!strategy.equals(LocatorUtils.property(thisLocator, "createdDate", lhsCreatedDate), LocatorUtils.property(thatLocator, "createdDate", rhsCreatedDate), lhsCreatedDate, rhsCreatedDate)) {
673 return false;
674 }
675 }
676 {
677 Date lhsDestroyedDate;
678 lhsDestroyedDate = this.getDestroyedDate();
679 Date rhsDestroyedDate;
680 rhsDestroyedDate = that.getDestroyedDate();
681 if (!strategy.equals(LocatorUtils.property(thisLocator, "destroyedDate", lhsDestroyedDate), LocatorUtils.property(thatLocator, "destroyedDate", rhsDestroyedDate), lhsDestroyedDate, rhsDestroyedDate)) {
682 return false;
683 }
684 }
685 {
686 String lhsIpInformation;
687 lhsIpInformation = this.getIpInformation();
688 String rhsIpInformation;
689 rhsIpInformation = that.getIpInformation();
690 if (!strategy.equals(LocatorUtils.property(thisLocator, "ipInformation", lhsIpInformation), LocatorUtils.property(thatLocator, "ipInformation", rhsIpInformation), lhsIpInformation, rhsIpInformation)) {
691 return false;
692 }
693 }
694 {
695 String lhsUserAgentInformation;
696 lhsUserAgentInformation = this.getUserAgentInformation();
697 String rhsUserAgentInformation;
698 rhsUserAgentInformation = that.getUserAgentInformation();
699 if (!strategy.equals(LocatorUtils.property(thisLocator, "userAgentInformation", lhsUserAgentInformation), LocatorUtils.property(thatLocator, "userAgentInformation", rhsUserAgentInformation), lhsUserAgentInformation, rhsUserAgentInformation)) {
700 return false;
701 }
702 }
703 {
704 String lhsSessionId;
705 lhsSessionId = this.getSessionId();
706 String rhsSessionId;
707 rhsSessionId = that.getSessionId();
708 if (!strategy.equals(LocatorUtils.property(thisLocator, "sessionId", lhsSessionId), LocatorUtils.property(thatLocator, "sessionId", rhsSessionId), lhsSessionId, rhsSessionId)) {
709 return false;
710 }
711 }
712 {
713 String lhsUserId;
714 lhsUserId = this.getUserId();
715 String rhsUserId;
716 rhsUserId = that.getUserId();
717 if (!strategy.equals(LocatorUtils.property(thisLocator, "userId", lhsUserId), LocatorUtils.property(thatLocator, "userId", rhsUserId), lhsUserId, rhsUserId)) {
718 return false;
719 }
720 }
721 {
722 String lhsLocale;
723 lhsLocale = this.getLocale();
724 String rhsLocale;
725 rhsLocale = that.getLocale();
726 if (!strategy.equals(LocatorUtils.property(thisLocator, "locale", lhsLocale), LocatorUtils.property(thatLocator, "locale", rhsLocale), lhsLocale, rhsLocale)) {
727 return false;
728 }
729 }
730 {
731 String lhsOperatingSystem;
732 lhsOperatingSystem = this.getOperatingSystem();
733 String rhsOperatingSystem;
734 rhsOperatingSystem = that.getOperatingSystem();
735 if (!strategy.equals(LocatorUtils.property(thisLocator, "operatingSystem", lhsOperatingSystem), LocatorUtils.property(thatLocator, "operatingSystem", rhsOperatingSystem), lhsOperatingSystem, rhsOperatingSystem)) {
736 return false;
737 }
738 }
739 {
740 ApplicationSessionType lhsSessionType;
741 lhsSessionType = this.getSessionType();
742 ApplicationSessionType rhsSessionType;
743 rhsSessionType = that.getSessionType();
744 if (!strategy.equals(LocatorUtils.property(thisLocator, "sessionType", lhsSessionType), LocatorUtils.property(thatLocator, "sessionType", rhsSessionType), lhsSessionType, rhsSessionType)) {
745 return false;
746 }
747 }
748 {
749 List<ApplicationActionEvent> lhsEvents;
750 lhsEvents = (((this.events!= null)&&(!this.events.isEmpty()))?this.getEvents():null);
751 List<ApplicationActionEvent> rhsEvents;
752 rhsEvents = (((that.events!= null)&&(!that.events.isEmpty()))?that.getEvents():null);
753 if (!strategy.equals(LocatorUtils.property(thisLocator, "events", lhsEvents), LocatorUtils.property(thatLocator, "events", rhsEvents), lhsEvents, rhsEvents)) {
754 return false;
755 }
756 }
757 return true;
758 }
759
760 public boolean equals(Object object) {
761 final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE;
762 return equals(null, null, object, strategy);
763 }
764
765 public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) {
766 int currentHashCode = 1;
767 {
768 Integer theModelObjectId;
769 theModelObjectId = this.getModelObjectId();
770 currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "modelObjectId", theModelObjectId), currentHashCode, theModelObjectId);
771 }
772 {
773 Integer theModelObjectVersion;
774 theModelObjectVersion = this.getModelObjectVersion();
775 currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "modelObjectVersion", theModelObjectVersion), currentHashCode, theModelObjectVersion);
776 }
777 {
778 Date theCreatedDate;
779 theCreatedDate = this.getCreatedDate();
780 currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "createdDate", theCreatedDate), currentHashCode, theCreatedDate);
781 }
782 {
783 Date theDestroyedDate;
784 theDestroyedDate = this.getDestroyedDate();
785 currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "destroyedDate", theDestroyedDate), currentHashCode, theDestroyedDate);
786 }
787 {
788 String theIpInformation;
789 theIpInformation = this.getIpInformation();
790 currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "ipInformation", theIpInformation), currentHashCode, theIpInformation);
791 }
792 {
793 String theUserAgentInformation;
794 theUserAgentInformation = this.getUserAgentInformation();
795 currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "userAgentInformation", theUserAgentInformation), currentHashCode, theUserAgentInformation);
796 }
797 {
798 String theSessionId;
799 theSessionId = this.getSessionId();
800 currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "sessionId", theSessionId), currentHashCode, theSessionId);
801 }
802 {
803 String theUserId;
804 theUserId = this.getUserId();
805 currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "userId", theUserId), currentHashCode, theUserId);
806 }
807 {
808 String theLocale;
809 theLocale = this.getLocale();
810 currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "locale", theLocale), currentHashCode, theLocale);
811 }
812 {
813 String theOperatingSystem;
814 theOperatingSystem = this.getOperatingSystem();
815 currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "operatingSystem", theOperatingSystem), currentHashCode, theOperatingSystem);
816 }
817 {
818 ApplicationSessionType theSessionType;
819 theSessionType = this.getSessionType();
820 currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "sessionType", theSessionType), currentHashCode, theSessionType);
821 }
822 {
823 List<ApplicationActionEvent> theEvents;
824 theEvents = (((this.events!= null)&&(!this.events.isEmpty()))?this.getEvents():null);
825 currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "events", theEvents), currentHashCode, theEvents);
826 }
827 return currentHashCode;
828 }
829
830 public int hashCode() {
831 final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE;
832 return this.hashCode(null, strategy);
833 }
834
835 }