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