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 | 0 | 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 | 0 | return kimTypeId; |
56 | |
} |
57 | |
|
58 | |
|
59 | |
|
60 | |
|
61 | |
public boolean isActive() { |
62 | 0 | return active; |
63 | |
} |
64 | |
|
65 | |
|
66 | |
|
67 | |
|
68 | |
public void setActive(boolean active) { |
69 | 0 | this.active = active; |
70 | 0 | } |
71 | |
|
72 | |
public KimType getKimType() { |
73 | 0 | return KimApiServiceLocator.getKimTypeInfoService().getKimType(kimTypeId); |
74 | |
} |
75 | |
|
76 | |
|
77 | |
|
78 | |
|
79 | |
public String getDescription() { |
80 | 0 | return description; |
81 | |
} |
82 | |
|
83 | |
|
84 | |
|
85 | |
|
86 | |
public String getPermissionTemplateId() { |
87 | 0 | return permissionTemplateId; |
88 | |
} |
89 | |
|
90 | |
|
91 | |
|
92 | |
|
93 | |
public String getName() { |
94 | 0 | return name; |
95 | |
} |
96 | |
|
97 | |
public void setKimTypeId(String kimTypeId) { |
98 | 0 | this.kimTypeId = kimTypeId; |
99 | 0 | } |
100 | |
|
101 | |
public void setDescription(String description) { |
102 | 0 | this.description = description; |
103 | 0 | } |
104 | |
|
105 | |
public void setName(String name) { |
106 | 0 | this.name = name; |
107 | 0 | } |
108 | |
|
109 | |
public String getNamespaceCode() { |
110 | 0 | return this.namespaceCode; |
111 | |
} |
112 | |
|
113 | |
public void setNamespaceCode(String namespaceCode) { |
114 | 0 | this.namespaceCode = namespaceCode; |
115 | 0 | } |
116 | |
|
117 | |
public void setPermissionTemplateId(String permissionTemplateId) { |
118 | 0 | this.permissionTemplateId = permissionTemplateId; |
119 | 0 | } |
120 | |
|
121 | |
public KimPermissionTemplateInfo toSimpleInfo() { |
122 | 0 | KimPermissionTemplateInfo dto = new KimPermissionTemplateInfo(); |
123 | |
|
124 | 0 | dto.setPermissionTemplateId( getPermissionTemplateId() ); |
125 | 0 | dto.setName( getName() ); |
126 | 0 | dto.setNamespaceCode( getNamespaceCode() ); |
127 | 0 | dto.setDescription( getDescription() ); |
128 | 0 | dto.setKimTypeId( getKimTypeId() ); |
129 | 0 | dto.setActive( isActive() ); |
130 | |
|
131 | 0 | return dto; |
132 | |
} |
133 | |
|
134 | |
} |