View Javadoc

1   /**
2    * Copyright 2005-2013 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 org.apache.commons.lang.StringUtils;
19  import org.kuali.rice.kim.api.services.KimApiServiceLocator;
20  import org.kuali.rice.kim.impl.type.KimTypeBo;
21  
22  import javax.persistence.Column;
23  import javax.persistence.Entity;
24  import javax.persistence.GeneratedValue;
25  import javax.persistence.Id;
26  import javax.persistence.IdClass;
27  import javax.persistence.Table;
28  import javax.persistence.Transient;
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  @IdClass(PersonDocumentGroupId.class) 
37  @Entity
38  @Table(name="KRIM_PND_GRP_PRNCPL_MT")
39  public class PersonDocumentGroup extends KimDocumentBoActivatableToFromEditableBase {
40  	private static final long serialVersionUID = -1551337026170706411L;
41  	@Id
42  	@GeneratedValue(generator="KRIM_GRP_MBR_ID_S")
43  	@Column(name="GRP_MBR_ID")
44  	protected String groupMemberId;
45  	@Column(name="GRP_TYPE")
46  	protected String groupType;
47  		
48  	@Column(name="GRP_ID")
49  	protected String groupId;
50  	@Column(name="GRP_NM")
51  	protected String groupName;
52  	@Column(name="NMSPC_CD")
53  	protected String namespaceCode;
54  	@Column(name="PRNCPL_ID")
55  	protected String principalId;
56  	@Transient
57  	protected transient KimTypeBo kimGroupType;
58  	@Transient
59  	protected String kimTypeId;
60  	
61  	public String getGroupId() {
62  		return this.groupId;
63  	}
64  
65  	public void setGroupId(String groupId) {
66  		this.groupId = groupId;
67  	}
68  
69  	public String getGroupName() {
70  		return this.groupName;
71  	}
72  
73  	public void setGroupName(String groupName) {
74  		this.groupName = groupName;
75  	}
76  
77  	public KimTypeBo getKimGroupType() {
78          if (StringUtils.isNotBlank(getKimTypeId())) {
79              if ( kimGroupType == null || (!StringUtils.equals( kimGroupType.getId(), kimTypeId )) ) {
80  			    kimGroupType = KimTypeBo.from(KimApiServiceLocator.getKimTypeInfoService().getKimType(kimTypeId));
81  		    }
82          }
83  		return kimGroupType;
84  	}
85  
86  	public String getKimTypeId() {
87  		return this.kimTypeId;
88  	}
89  
90  	public void setKimTypeId(String kimTypeId) {
91  		this.kimTypeId = kimTypeId;
92  	}
93  
94  	public String getGroupMemberId() {
95  		return this.groupMemberId;
96  	}
97  
98  	public void setGroupMemberId(String groupMemberId) {
99  		this.groupMemberId = groupMemberId;
100 	}
101 
102 	public String getPrincipalId() {
103 		return this.principalId;
104 	}
105 
106 	public void setPrincipalId(String principalId) {
107 		this.principalId = principalId;
108 	}
109 
110 	public String getGroupType() {
111 		return this.groupType;
112 	}
113 
114 	public void setGroupType(String groupType) {
115 		this.groupType = groupType;
116 	}
117 
118 	public String getNamespaceCode() {
119 		return this.namespaceCode;
120 	}
121 
122 	public void setNamespaceCode(String namespaceCode) {
123 		this.namespaceCode = namespaceCode;
124 	}
125 
126 
127 }