View Javadoc
1   /**
2    * Copyright 2005-2016 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.kim.bo.ui;
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 javax.persistence.Transient;
24  
25  import org.apache.commons.lang.StringUtils;
26  import org.kuali.rice.kim.api.services.KimApiServiceLocator;
27  import org.kuali.rice.kim.impl.type.KimTypeBo;
28  import org.kuali.rice.krad.data.jpa.PortableSequenceGenerator;
29  
30  /**
31   * This is a description of what this class does - shyu don't forget to fill this in. 
32   * 
33   * @author Kuali Rice Team (rice.collab@kuali.org)
34   *
35   */
36  @Entity
37  @Table(name = "KRIM_PND_GRP_PRNCPL_MT")
38  public class PersonDocumentGroup extends KimDocumentBoActivatableToFromEditableBase {
39  
40      private static final long serialVersionUID = -1551337026170706411L;
41  
42      @PortableSequenceGenerator(name = "KRIM_GRP_MBR_ID_S")
43      @GeneratedValue(generator = "KRIM_GRP_MBR_ID_S")
44      @Id
45      @Column(name = "GRP_MBR_ID")
46      protected String groupMemberId;
47  
48      @Column(name = "GRP_TYPE")
49      protected String groupType;
50  
51      @Column(name = "GRP_ID")
52      protected String groupId;
53  
54      @Column(name = "GRP_NM")
55      protected String groupName;
56  
57      @Column(name = "NMSPC_CD")
58      protected String namespaceCode;
59  
60      @Column(name = "PRNCPL_ID")
61      protected String principalId;
62  
63      @Transient
64      protected transient KimTypeBo kimGroupType;
65  
66      @Transient
67      protected String kimTypeId;
68  
69      public String getGroupId() {
70          return this.groupId;
71      }
72  
73      public void setGroupId(String groupId) {
74          this.groupId = groupId;
75      }
76  
77      public String getGroupName() {
78          return this.groupName;
79      }
80  
81      public void setGroupName(String groupName) {
82          this.groupName = groupName;
83      }
84  
85      public KimTypeBo getKimGroupType() {
86          if (StringUtils.isNotBlank(getKimTypeId())) {
87              if (kimGroupType == null || (!StringUtils.equals(kimGroupType.getId(), kimTypeId))) {
88                  kimGroupType = KimTypeBo.from(KimApiServiceLocator.getKimTypeInfoService().getKimType(kimTypeId));
89              }
90          }
91          return kimGroupType;
92      }
93  
94      public String getKimTypeId() {
95          return this.kimTypeId;
96      }
97  
98      public void setKimTypeId(String kimTypeId) {
99          this.kimTypeId = kimTypeId;
100     }
101 
102     public String getGroupMemberId() {
103         return this.groupMemberId;
104     }
105 
106     public void setGroupMemberId(String groupMemberId) {
107         this.groupMemberId = groupMemberId;
108     }
109 
110     public String getPrincipalId() {
111         return this.principalId;
112     }
113 
114     public void setPrincipalId(String principalId) {
115         this.principalId = principalId;
116     }
117 
118     public String getGroupType() {
119         return this.groupType;
120     }
121 
122     public void setGroupType(String groupType) {
123         this.groupType = groupType;
124     }
125 
126     public String getNamespaceCode() {
127         return this.namespaceCode;
128     }
129 
130     public void setNamespaceCode(String namespaceCode) {
131         this.namespaceCode = namespaceCode;
132     }
133 }