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.Table;
23 import org.kuali.rice.kim.api.common.template.Template;
24 import org.kuali.rice.kim.api.common.template.TemplateContract;
25 import org.kuali.rice.kim.impl.common.template.TemplateBo;
26 import org.kuali.rice.krad.data.jpa.PortableSequenceGenerator;
27
28
29
30
31 @Entity
32 @Table(name = "KRIM_RSP_TMPL_T")
33 public class ResponsibilityTemplateBo extends TemplateBo implements TemplateContract {
34
35 private static final long serialVersionUID = 1L;
36
37 @PortableSequenceGenerator(name = "KRIM_RSP_TMPL_ID_S")
38 @GeneratedValue(generator = "KRIM_RSP_TMPL_ID_S")
39 @Id
40 @Column(name = "RSP_TMPL_ID")
41 private String id;
42
43
44
45
46
47
48
49 public static Template to(TemplateContract bo) {
50 if (bo == null) {
51 return null;
52 }
53 return Template.Builder.create(bo).build();
54 }
55
56
57
58
59
60
61
62 public static ResponsibilityTemplateBo from(TemplateContract im) {
63 if (im == null) {
64 return null;
65 }
66 ResponsibilityTemplateBo bo = new ResponsibilityTemplateBo();
67 bo.id = im.getId();
68 bo.setNamespaceCode(im.getNamespaceCode());
69 bo.setName(im.getName());
70 bo.setDescription(im.getDescription());
71 bo.setActive(im.isActive());
72 bo.setKimTypeId(im.getKimTypeId());
73 bo.setVersionNumber(im.getVersionNumber());
74 bo.setObjectId(im.getObjectId());
75 return bo;
76 }
77
78 @Override
79 public String getId() {
80 return id;
81 }
82
83 public void setId(String id) {
84 this.id = id;
85 }
86 }