1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.kim.bo.role.impl;
17
18 import org.hibernate.annotations.Type;
19 import org.kuali.rice.kim.api.services.KimApiServiceLocator;
20 import org.kuali.rice.kim.api.type.KimType;
21 import org.kuali.rice.kim.bo.role.KimPermissionTemplate;
22 import org.kuali.rice.kim.bo.role.dto.KimPermissionTemplateInfo;
23 import org.kuali.rice.krad.bo.PersistableBusinessObjectBase;
24
25 import javax.persistence.Column;
26 import javax.persistence.Entity;
27 import javax.persistence.Id;
28 import javax.persistence.Table;
29
30
31
32
33 @Entity
34 @Table(name="KRIM_PERM_TMPL_T")
35 public class KimPermissionTemplateImpl extends PersistableBusinessObjectBase implements KimPermissionTemplate {
36
37 private static final long serialVersionUID = 1L;
38
39 @Id
40 @Column(name="PERM_TMPL_ID")
41 protected String permissionTemplateId;
42 @Column(name="NMSPC_CD")
43 protected String namespaceCode;
44 @Column(name="NM")
45 protected String name;
46 @Column(name="KIM_TYP_ID")
47 protected String kimTypeId;
48 @Column(name="DESC_TXT", length=400)
49 protected String description;
50 @Type(type="yes_no")
51 @Column(name="ACTV_IND")
52 protected boolean active;
53
54 public String getKimTypeId() {
55 return kimTypeId;
56 }
57
58
59
60
61 public boolean isActive() {
62 return active;
63 }
64
65
66
67
68 public void setActive(boolean active) {
69 this.active = active;
70 }
71
72 public KimType getKimType() {
73 return KimApiServiceLocator.getKimTypeInfoService().getKimType(kimTypeId);
74 }
75
76
77
78
79 public String getDescription() {
80 return description;
81 }
82
83
84
85
86 public String getPermissionTemplateId() {
87 return permissionTemplateId;
88 }
89
90
91
92
93 public String getName() {
94 return name;
95 }
96
97 public void setKimTypeId(String kimTypeId) {
98 this.kimTypeId = kimTypeId;
99 }
100
101 public void setDescription(String description) {
102 this.description = description;
103 }
104
105 public void setName(String name) {
106 this.name = name;
107 }
108
109 public String getNamespaceCode() {
110 return this.namespaceCode;
111 }
112
113 public void setNamespaceCode(String namespaceCode) {
114 this.namespaceCode = namespaceCode;
115 }
116
117 public void setPermissionTemplateId(String permissionTemplateId) {
118 this.permissionTemplateId = permissionTemplateId;
119 }
120
121 public KimPermissionTemplateInfo toSimpleInfo() {
122 KimPermissionTemplateInfo dto = new KimPermissionTemplateInfo();
123
124 dto.setPermissionTemplateId( getPermissionTemplateId() );
125 dto.setName( getName() );
126 dto.setNamespaceCode( getNamespaceCode() );
127 dto.setDescription( getDescription() );
128 dto.setKimTypeId( getKimTypeId() );
129 dto.setActive( isActive() );
130
131 return dto;
132 }
133
134 }