1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
|
17 | |
|
18 | |
|
19 | |
|
20 | |
|
21 | |
package org.kuali.rice.kim.impl.role; |
22 | |
|
23 | |
|
24 | |
import javax.persistence.Column |
25 | |
import javax.persistence.Entity |
26 | |
import javax.persistence.Id |
27 | |
import javax.persistence.JoinColumn |
28 | |
import javax.persistence.ManyToOne |
29 | |
import javax.persistence.Table |
30 | |
import org.hibernate.annotations.Type |
31 | |
import org.kuali.rice.kim.api.role.RoleResponsibility |
32 | |
import org.kuali.rice.kim.api.role.RoleResponsibilityContract |
33 | |
import org.kuali.rice.krad.bo.PersistableBusinessObjectBase |
34 | |
import javax.persistence.FetchType |
35 | |
import org.kuali.rice.kim.impl.responsibility.ResponsibilityBo |
36 | |
|
37 | |
|
38 | |
|
39 | |
|
40 | |
@Entity |
41 | |
@Table(name = "KRIM_ROLE_RSP_T") |
42 | |
public class RoleResponsibilityBo extends PersistableBusinessObjectBase implements RoleResponsibilityContract { |
43 | |
private static final long serialVersionUID = 1L; |
44 | |
|
45 | |
@Id |
46 | |
@Column(name = "ROLE_RSP_ID") |
47 | |
String roleResponsibilityId; |
48 | |
|
49 | |
@Column(name = "ROLE_ID") |
50 | |
String roleId; |
51 | |
|
52 | |
@Column(name = "RSP_ID") |
53 | |
String responsibilityId; |
54 | |
|
55 | |
@Type(type = "yes_no") |
56 | |
@Column(name = "ACTV_IND") |
57 | |
boolean active; |
58 | |
|
59 | |
@ManyToOne(targetEntity = ResponsibilityBo.class, fetch = FetchType.EAGER, cascade = []) |
60 | |
@JoinColumn(name = "RSP_ID", insertable = false, updatable = false) |
61 | |
ResponsibilityBo kimResponsibility; |
62 | |
|
63 | |
|
64 | |
public static RoleResponsibility to(RoleResponsibilityBo bo) { |
65 | 0 | if (bo == null) { return null;} |
66 | 0 | return RoleResponsibility.Builder.create(bo).build(); |
67 | |
} |
68 | |
|
69 | |
public static RoleResponsibilityBo from(RoleResponsibility immutable) { |
70 | 0 | if (immutable == null) { return null; } |
71 | |
|
72 | 0 | RoleResponsibilityBo bo = new RoleResponsibilityBo(); |
73 | 0 | bo.roleResponsibilityId = immutable.roleResponsibilityId |
74 | 0 | bo.roleId = immutable.roleId |
75 | 0 | bo.responsibilityId = immutable.responsibilityId |
76 | 0 | bo.active = immutable.active |
77 | 0 | bo.versionNumber = immutable.versionNumber |
78 | |
|
79 | 0 | return bo |
80 | |
} |
81 | |
|
82 | |
} |