1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.kim.impl.permission;
17
18 import javax.persistence.Column;
19 import javax.persistence.Entity;
20 import javax.persistence.GeneratedValue;
21 import javax.persistence.Id;
22 import javax.persistence.Table;
23
24 import org.kuali.rice.kim.api.common.attribute.KimAttributeData;
25 import org.kuali.rice.kim.api.common.attribute.KimAttributeDataContract;
26 import org.kuali.rice.kim.impl.common.attribute.KimAttributeBo;
27 import org.kuali.rice.kim.impl.common.attribute.KimAttributeDataBo;
28 import org.kuali.rice.krad.bo.BusinessObject;
29 import org.kuali.rice.krad.data.jpa.PortableSequenceGenerator;
30
31
32
33
34 @Entity
35 @Table(name = "KRIM_PERM_ATTR_DATA_T")
36 public class PermissionAttributeBo extends KimAttributeDataBo implements KimAttributeDataContract, BusinessObject {
37 private static final long serialVersionUID = 1L;
38
39 @PortableSequenceGenerator(name = "KRIM_ATTR_DATA_ID_S")
40 @GeneratedValue(generator = "KRIM_ATTR_DATA_ID_S")
41 @Id
42 @Column(name = "ATTR_DATA_ID")
43 private String id;
44
45 @Column(name = "PERM_ID")
46 private String assignedToId;
47
48 @Override
49 public String getId() {
50 return id;
51 }
52
53 @Override
54 public void setId(String id) {
55 this.id = id;
56 }
57
58 @Override
59 public String getAssignedToId() {
60 return assignedToId;
61 }
62
63 @Override
64 public void setAssignedToId(String assignedToId) {
65 this.assignedToId = assignedToId;
66 }
67
68
69
70
71
72
73 public static KimAttributeData to(PermissionAttributeBo bo) {
74 if (bo == null) {
75 return null;
76 }
77 return KimAttributeData.Builder.create(bo).build();
78 }
79
80
81
82
83
84
85 public static PermissionAttributeBo from(KimAttributeData im) {
86 if (im == null) {
87 return null;
88 }
89 PermissionAttributeBo bo = new PermissionAttributeBo();
90 bo.setId(im.getId());
91 bo.setAssignedToId(im.getAssignedToId());
92 bo.setKimAttribute(KimAttributeBo.from(im.getKimAttribute()));
93 bo.setKimAttributeId(im.getKimAttribute() != null ? im.getKimAttribute().getId() : null);
94 bo.setAttributeValue(bo.getAttributeValue());
95 bo.setKimTypeId(im.getKimTypeId());
96 bo.setVersionNumber(im.getVersionNumber());
97 bo.setObjectId(im.getObjectId());
98 return bo;
99 }
100
101 @Override
102 public void refresh() {
103 }
104 }