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 org.hibernate.annotations.GenericGenerator; |
19 | |
import org.hibernate.annotations.Parameter; |
20 | |
import org.kuali.rice.kim.api.responsibility.Responsibility; |
21 | |
import org.kuali.rice.kim.api.services.KimApiServiceLocator; |
22 | |
import org.kuali.rice.kim.impl.responsibility.ResponsibilityBo; |
23 | |
import org.springframework.util.AutoPopulatingList; |
24 | |
|
25 | |
import javax.persistence.Column; |
26 | |
import javax.persistence.Entity; |
27 | |
import javax.persistence.GeneratedValue; |
28 | |
import javax.persistence.Id; |
29 | |
import javax.persistence.IdClass; |
30 | |
import javax.persistence.Table; |
31 | |
import javax.persistence.Transient; |
32 | |
import java.util.List; |
33 | |
|
34 | |
|
35 | |
|
36 | |
|
37 | |
@IdClass(KimDocumentRoleResponsibilityId.class) |
38 | |
@Entity |
39 | |
@Table(name="KRIM_PND_ROLE_RSP_T") |
40 | 0 | public class KimDocumentRoleResponsibility extends KimDocumentBoActivatableBase { |
41 | |
|
42 | |
private static final long serialVersionUID = -4465768714850961538L; |
43 | |
@Id |
44 | |
@GeneratedValue(generator="KRIM_ROLE_RSP_ACTN_ID_S") |
45 | |
@GenericGenerator(name="KRIM_ROLE_RSP_ACTN_ID_S",strategy="org.kuali.rice.core.jpa.spring.RiceNumericStringSequenceStyleGenerator",parameters={ |
46 | |
@Parameter(name="sequence_name",value="KRIM_ROLE_RSP_ACTN_ID_S"), |
47 | |
@Parameter(name="value_column",value="id") |
48 | |
}) |
49 | |
@Column(name="ROLE_RSP_ID") |
50 | |
protected String roleResponsibilityId; |
51 | |
@Column(name="ROLE_ID") |
52 | |
protected String roleId; |
53 | |
@Column(name="RSP_ID") |
54 | |
protected String responsibilityId; |
55 | |
@Transient |
56 | |
protected ResponsibilityBo kimResponsibility; |
57 | 0 | @Transient |
58 | |
protected List<KimDocumentRoleResponsibilityAction> roleRspActions = new AutoPopulatingList(KimDocumentRoleResponsibilityAction.class); |
59 | |
|
60 | |
public String getRoleId() { |
61 | 0 | return roleId; |
62 | |
} |
63 | |
|
64 | |
public void setRoleId(String roleId) { |
65 | 0 | this.roleId = roleId; |
66 | 0 | } |
67 | |
|
68 | |
public void setRoleResponsibilityId(String roleResponsibilityId) { |
69 | 0 | this.roleResponsibilityId = roleResponsibilityId; |
70 | 0 | } |
71 | |
|
72 | |
|
73 | |
|
74 | |
|
75 | |
public String getRoleResponsibilityId() { |
76 | 0 | return this.roleResponsibilityId; |
77 | |
} |
78 | |
|
79 | |
|
80 | |
|
81 | |
|
82 | |
public ResponsibilityBo getKimResponsibility() { |
83 | 0 | if ( kimResponsibility == null && responsibilityId != null ) { |
84 | |
|
85 | |
|
86 | |
|
87 | 0 | Responsibility info = KimApiServiceLocator.getResponsibilityService().getResponsibility(getResponsibilityId()); |
88 | 0 | kimResponsibility = ResponsibilityBo.from(info); |
89 | |
} |
90 | 0 | return this.kimResponsibility; |
91 | |
} |
92 | |
|
93 | |
|
94 | |
|
95 | |
|
96 | |
public void setResponsibilityId(String responsibilityId) { |
97 | 0 | this.responsibilityId = responsibilityId; |
98 | 0 | } |
99 | |
|
100 | |
|
101 | |
|
102 | |
|
103 | |
public void setKimResponsibility(ResponsibilityBo kimResponsibility) { |
104 | 0 | this.kimResponsibility = kimResponsibility; |
105 | 0 | } |
106 | |
|
107 | |
|
108 | |
|
109 | |
|
110 | |
public String getResponsibilityId() { |
111 | 0 | return this.responsibilityId; |
112 | |
} |
113 | |
|
114 | |
|
115 | |
|
116 | |
|
117 | |
public KimDocumentRoleResponsibilityAction getRoleRspAction() { |
118 | 0 | if(this.roleRspActions!=null && this.roleRspActions.size()>0) |
119 | 0 | return this.roleRspActions.get(0); |
120 | 0 | return null; |
121 | |
} |
122 | |
|
123 | |
|
124 | |
|
125 | |
|
126 | |
public List<KimDocumentRoleResponsibilityAction> getRoleRspActions() { |
127 | 0 | return this.roleRspActions; |
128 | |
} |
129 | |
|
130 | |
|
131 | |
|
132 | |
|
133 | |
public void setRoleRspActions( |
134 | |
List<KimDocumentRoleResponsibilityAction> roleRspActions) { |
135 | 0 | this.roleRspActions = roleRspActions; |
136 | 0 | } |
137 | |
|
138 | |
} |