1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
|
17 | |
package org.kuali.rice.kim.impl.role; |
18 | |
|
19 | |
|
20 | |
import javax.persistence.Column |
21 | |
import javax.persistence.Entity |
22 | |
import javax.persistence.FetchType |
23 | |
import javax.persistence.Id |
24 | |
import javax.persistence.JoinColumn |
25 | |
import javax.persistence.ManyToOne |
26 | |
import javax.persistence.Table |
27 | |
import org.hibernate.annotations.Type |
28 | |
import org.kuali.rice.kim.api.role.RoleResponsibilityAction |
29 | |
import org.kuali.rice.kim.api.role.RoleResponsibilityActionContract |
30 | |
import org.kuali.rice.krad.bo.PersistableBusinessObjectBase |
31 | |
|
32 | |
|
33 | |
|
34 | |
|
35 | |
|
36 | |
|
37 | |
|
38 | |
@Entity |
39 | |
@Table(name = "KRIM_ROLE_RSP_ACTN_T") |
40 | |
public class RoleResponsibilityActionBo extends PersistableBusinessObjectBase implements RoleResponsibilityActionContract { |
41 | |
|
42 | |
private static final long serialVersionUID = -2840071737863303404L; |
43 | |
|
44 | |
@Id |
45 | |
@Column(name = "ROLE_RSP_ACTN_ID") |
46 | |
String id; |
47 | |
|
48 | |
@Column(name = "ROLE_RSP_ID") |
49 | |
String roleResponsibilityId; |
50 | |
|
51 | |
@Column(name = "ROLE_MBR_ID") |
52 | |
String roleMemberId; |
53 | |
|
54 | |
@Column(name = "ACTN_TYP_CD") |
55 | |
String actionTypeCode; |
56 | |
|
57 | |
@Column(name = "ACTN_PLCY_CD") |
58 | |
String actionPolicyCode; |
59 | |
|
60 | |
@Column(name = "FRC_ACTN") |
61 | |
@Type(type = "yes_no") |
62 | |
boolean forceAction; |
63 | |
|
64 | |
@Column(name = "PRIORITY_NBR") |
65 | |
Integer priorityNumber; |
66 | |
|
67 | |
@ManyToOne(targetEntity = RoleResponsibilityBo.class, fetch = FetchType.EAGER, cascade = []) |
68 | |
@JoinColumn(name = "ROLE_RSP_ID", insertable = false, updatable = false) |
69 | |
RoleResponsibilityBo roleResponsibility; |
70 | |
|
71 | |
public RoleResponsibilityBo getRoleResponsibility() { |
72 | 6 | return roleResponsibility |
73 | |
} |
74 | |
|
75 | |
|
76 | |
public static RoleResponsibilityAction to(RoleResponsibilityActionBo bo) { |
77 | 2 | if (bo == null) { return null;} |
78 | 2 | return RoleResponsibilityAction.Builder.create(bo).build(); |
79 | |
} |
80 | |
|
81 | |
public static RoleResponsibilityActionBo from(RoleResponsibilityAction immutable) { |
82 | 1 | if (immutable == null) { return null;} |
83 | |
|
84 | 1 | RoleResponsibilityActionBo bo = new RoleResponsibilityActionBo(); |
85 | 1 | bo.id = immutable.getId(); |
86 | 1 | bo.roleResponsibilityId = immutable.getRoleResponsibilityId(); |
87 | 1 | bo.roleMemberId = immutable.getRoleMemberId(); |
88 | 1 | bo.actionTypeCode = immutable.getActionTypeCode(); |
89 | 1 | bo.actionPolicyCode = immutable.getActionPolicyCode(); |
90 | 1 | bo.forceAction = immutable.isForceAction(); |
91 | 1 | bo.priorityNumber = immutable.getPriorityNumber(); |
92 | 1 | bo.roleResponsibility = RoleResponsibilityBo.from(immutable.getRoleResponsibility()); |
93 | 1 | bo.versionNumber = immutable.getVersionNumber(); |
94 | 1 | return bo; |
95 | |
} |
96 | |
} |