1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.kim.bo.ui;
17
18 import javax.persistence.CascadeType;
19 import javax.persistence.Column;
20 import javax.persistence.Convert;
21 import javax.persistence.Entity;
22 import javax.persistence.GeneratedValue;
23 import javax.persistence.Id;
24 import javax.persistence.JoinColumn;
25 import javax.persistence.ManyToOne;
26 import javax.persistence.Table;
27 import javax.persistence.Transient;
28
29 import org.eclipse.persistence.annotations.JoinFetch;
30 import org.eclipse.persistence.annotations.JoinFetchType;
31 import org.kuali.rice.kew.api.util.CodeTranslator;
32 import org.kuali.rice.kim.api.responsibility.Responsibility;
33 import org.kuali.rice.kim.api.services.KimApiServiceLocator;
34 import org.kuali.rice.kim.impl.responsibility.ResponsibilityBo;
35 import org.kuali.rice.kim.impl.role.RoleResponsibilityBo;
36 import org.kuali.rice.krad.data.KradDataServiceLocator;
37 import org.kuali.rice.krad.data.jpa.converters.BooleanYNConverter;
38 import org.kuali.rice.krad.data.jpa.PortableSequenceGenerator;
39
40
41
42
43
44
45
46 @Entity
47 @Table(name = "KRIM_PND_ROLE_RSP_ACTN_MT")
48 public class KimDocumentRoleResponsibilityAction extends KimDocumentBoEditableBase {
49
50 private static final long serialVersionUID = 696663543888096105L;
51
52 @PortableSequenceGenerator(name = "KRIM_ROLE_RSP_ACTN_ID_S")
53 @GeneratedValue(generator = "KRIM_ROLE_RSP_ACTN_ID_S")
54 @Id
55 @Column(name = "ROLE_RSP_ACTN_ID")
56 protected String roleResponsibilityActionId;
57
58 @Column(name = "ROLE_RSP_ID")
59 protected String roleResponsibilityId;
60
61 @Column(name = "ROLE_MBR_ID")
62 protected String roleMemberId;
63
64 @Column(name = "ACTN_TYP_CD")
65 protected String actionTypeCode;
66
67 @Column(name = "ACTN_PLCY_CD")
68 protected String actionPolicyCode;
69
70 @Column(name = "PRIORITY_NBR")
71 protected Integer priorityNumber;
72
73 @Column(name = "FRC_ACTN")
74 @Convert(converter = BooleanYNConverter.class)
75 protected boolean forceAction;
76
77
78
79
80
81 @Transient
82 protected ResponsibilityBo kimResponsibility;
83
84 @JoinFetch(value= JoinFetchType.OUTER)
85 @ManyToOne(targetEntity = RoleResponsibilityBo.class, cascade = { CascadeType.REFRESH })
86 @JoinColumn(name = "ROLE_RSP_ID", referencedColumnName = "ROLE_RSP_ID", insertable = false, updatable = false)
87 protected RoleResponsibilityBo roleResponsibility;
88
89
90
91
92
93
94
95
96
97 public ResponsibilityBo getKimResponsibility() {
98 if (kimResponsibility == null && getRoleResponsibility() != null) {
99
100
101
102 Responsibility info = KimApiServiceLocator.getResponsibilityService().getResponsibility(getRoleResponsibility().getResponsibilityId());
103 kimResponsibility = ResponsibilityBo.from(info);
104 }
105 return kimResponsibility;
106 }
107
108
109
110
111 public void setKimResponsibility(ResponsibilityBo kimResponsibility) {
112 this.kimResponsibility = kimResponsibility;
113 }
114
115 public String getRoleResponsibilityActionId() {
116 return this.roleResponsibilityActionId;
117 }
118
119 public void setRoleResponsibilityActionId(String roleResponsibilityResolutionId) {
120 this.roleResponsibilityActionId = roleResponsibilityResolutionId;
121 }
122
123 public String getRoleResponsibilityId() {
124 return this.roleResponsibilityId;
125 }
126
127 public void setRoleResponsibilityId(String roleResponsibilityId) {
128 this.roleResponsibilityId = roleResponsibilityId;
129 }
130
131 public String getActionTypeCode() {
132 return this.actionTypeCode;
133 }
134
135 public void setActionTypeCode(String actionTypeCode) {
136 this.actionTypeCode = actionTypeCode;
137 }
138
139 public Integer getPriorityNumber() {
140 return this.priorityNumber;
141 }
142
143 public void setPriorityNumber(Integer priorityNumber) {
144 this.priorityNumber = priorityNumber;
145 }
146
147 public String getActionPolicyCode() {
148 return this.actionPolicyCode;
149 }
150
151 public void setActionPolicyCode(String actionPolicyCode) {
152 this.actionPolicyCode = actionPolicyCode;
153 }
154
155 public String getRoleMemberId() {
156 return this.roleMemberId;
157 }
158
159 public void setRoleMemberId(String roleMemberId) {
160 this.roleMemberId = roleMemberId;
161 }
162
163
164
165
166
167
168
169 public String getActionPolicyDescription() {
170 return CodeTranslator.approvePolicyLabels.get(this.actionPolicyCode);
171 }
172
173
174
175
176
177
178
179 public String getActionTypeDescription() {
180 return CodeTranslator.arLabels.get(this.actionTypeCode);
181 }
182
183
184
185
186 public RoleResponsibilityBo getRoleResponsibility() {
187 if (roleResponsibility == null && roleResponsibilityId != null) {
188
189
190
191 roleResponsibility = KradDataServiceLocator.getDataObjectService().find(RoleResponsibilityBo.class, getRoleResponsibilityId());
192 }
193 return roleResponsibility;
194 }
195
196
197
198
199 public void setRoleResponsibility(RoleResponsibilityBo roleResponsibility) {
200 this.roleResponsibility = roleResponsibility;
201 }
202
203
204
205
206 public boolean isForceAction() {
207 return this.forceAction;
208 }
209
210
211
212
213 public void setForceAction(boolean forceAction) {
214 this.forceAction = forceAction;
215 }
216 }