1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.kpme.core.bo;
17
18 import org.kuali.kpme.core.api.bo.HrKeyedBusinessObjectContract;
19 import org.kuali.kpme.core.groupkey.HrGroupKeyBo;
20 import org.kuali.kpme.core.institution.InstitutionBo;
21 import org.kuali.kpme.core.location.LocationBo;
22 import org.kuali.kpme.core.service.HrServiceLocator;
23
24 public abstract class HrKeyedBusinessObject extends HrBusinessObject implements HrKeyedBusinessObjectContract {
25
26 private static final long serialVersionUID = -4676316817255855400L;
27
28 protected String groupKeyCode;
29 protected transient HrGroupKeyBo groupKey;
30
31
32 protected transient String locationId;
33 protected transient String institutionCode;
34
35
36 protected transient InstitutionBo institutionObj;
37 protected transient LocationBo locationObj;
38
39 @Override
40 public String getGroupKeyCode() {
41 return groupKeyCode;
42 }
43
44 public void setGroupKeyCode(String groupKeyCode) {
45 this.groupKeyCode = groupKeyCode;
46 }
47
48 public String getLocationId() {
49 return locationId;
50 }
51
52 public void setLocationId(String locationId) {
53 this.locationId = locationId;
54 }
55
56 public String getInstitutionCode() {
57 return institutionCode;
58 }
59
60 public void setInstitutionCode(String institutionCode) {
61 this.institutionCode = institutionCode;
62 }
63
64 @Override
65 public HrGroupKeyBo getGroupKey() {
66 if (groupKey == null) {
67 groupKey = HrGroupKeyBo.from(HrServiceLocator.getHrGroupKeyService().getHrGroupKey(getGroupKeyCode(), this.getEffectiveLocalDate()));
68 }
69 return groupKey;
70 }
71
72 public void setGroupKey(HrGroupKeyBo groupKey) {
73 this.groupKey = groupKey;
74 }
75
76
77
78
79
80 public LocationBo getLocationObj() {
81 HrGroupKeyBo grpKey = getGroupKey();
82 if(grpKey != null) {
83 return grpKey.getLocation();
84 }
85 return null;
86 }
87
88
89
90
91
92 public InstitutionBo getInstitutionObj() {
93 HrGroupKeyBo grpKey = getGroupKey();
94 if(grpKey != null) {
95 return grpKey.getInstitution();
96 }
97 return null;
98 }
99
100
101
102
103 public String getInstitution() {
104 HrGroupKeyBo grpKey = getGroupKey();
105 if(grpKey != null) {
106 return grpKey.getInstitutionCode();
107 }
108 return null;
109 }
110
111
112
113
114
115 public String getLocation() {
116 HrGroupKeyBo grpKey = getGroupKey();
117 if(grpKey != null) {
118 return grpKey.getLocationId();
119 }
120 return null;
121 }
122
123 }