View Javadoc
1   /**
2    * Copyright 2005-2014 The Kuali Foundation
3    *
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    * http://www.opensource.org/licenses/ecl2.php
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.kuali.rice.krad.labs;
17  
18  import org.kuali.rice.kim.impl.role.RoleBo;
19  import org.kuali.rice.kim.impl.role.RoleMemberBo;
20  import org.kuali.rice.krad.bo.DataObjectBase;
21  import org.kuali.rice.krad.data.jpa.PortableSequenceGenerator;
22  import org.kuali.rice.krad.data.provider.annotation.Relationship;
23  
24  import javax.persistence.Column;
25  import javax.persistence.Entity;
26  import javax.persistence.GeneratedValue;
27  import javax.persistence.Id;
28  import javax.persistence.Table;
29  import javax.persistence.Transient;
30  
31  /**
32   * @author Kuali Rice Team (rice.collab@kuali.org)
33   */
34  @Entity
35  @Table(name = "KRIM_ROLE_MBR_T")
36  public class LabsRoleMember extends DataObjectBase {
37  
38      @Id
39      @GeneratedValue(generator = "KRIM_ROLE_MBR_ID_S")
40      @PortableSequenceGenerator(name = "KRIM_ROLE_MBR_ID_S")
41      @Column(name = "ROLE_MBR_ID")
42      private String id;
43  
44      private RoleMemberBo roleMember;
45  
46      @Column(name = "ROLE_ID")
47      private String roleId;
48  
49      @Relationship(foreignKeyFields="roleId")
50      @Transient
51      private RoleBo role;
52  
53      private String roleNamespaceCode;
54  
55      private String roleName;
56  
57      private String roleDescription;
58  
59      public String getId() {
60          return id;
61      }
62  
63      public void setId(String id) {
64          this.id = id;
65      }
66  
67      public RoleMemberBo getRoleMember() {
68          return roleMember;
69      }
70  
71      public void setRoleMember(RoleMemberBo roleMember) {
72          this.roleMember = roleMember;
73      }
74  
75      public String getRoleId() {
76          return roleId;
77      }
78  
79      public void setRoleId(String roleId) {
80          this.roleId = roleId;
81      }
82  
83      public RoleBo getRole() {
84          return role;
85      }
86  
87      public void setRole(RoleBo role) {
88          this.role = role;
89      }
90  
91      public String getRoleNamespaceCode() {
92          if (getRole() != null) {
93              roleNamespaceCode = getRole().getNamespaceCode();
94          }
95  
96          return roleNamespaceCode;
97      }
98  
99      public void setRoleNamespaceCode(String roleNamespaceCode) {
100         this.roleNamespaceCode = roleNamespaceCode;
101     }
102 
103     public String getRoleName() {
104         if (getRole() != null) {
105             roleName = getRole().getName();
106         }
107 
108         return roleName;
109     }
110 
111     public void setRoleName(String roleName) {
112         this.roleName = roleName;
113     }
114 
115     public String getRoleDescription() {
116         if (getRole() != null) {
117             roleDescription = getRole().getDescription();
118         }
119 
120         return roleDescription;
121     }
122 
123     public void setRoleDescription(String roleDescription) {
124         this.roleDescription = roleDescription;
125     }
126 }