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