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