View Javadoc

1   /*
2    * Copyright 2007-2009 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 java.util.ArrayList;
19  import java.util.LinkedHashMap;
20  import java.util.List;
21  
22  import javax.persistence.Column;
23  import javax.persistence.Entity;
24  import javax.persistence.Id;
25  import javax.persistence.Table;
26  
27  import org.kuali.rice.kim.bo.reference.impl.AffiliationTypeImpl;
28  import org.kuali.rice.kns.util.ObjectUtils;
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_AFLTN_MT")
38  public class PersonDocumentAffiliation extends PersonDocumentBoDefaultBase {
39  	private static final long serialVersionUID = 1L;
40  
41  	@Id
42  	@Column(name = "ENTITY_AFLTN_ID")
43  	protected String entityAffiliationId;
44  
45  	@Column(name = "AFLTN_TYP_CD")
46  	protected String affiliationTypeCode;
47  
48  	@Column(name = "CAMPUS_CD")
49  	protected String campusCode;
50  
51  	protected AffiliationTypeImpl affiliationType;
52  	protected PersonDocumentEmploymentInfo newEmpInfo;
53  	protected List<PersonDocumentEmploymentInfo> empInfos;
54  
55  	public PersonDocumentAffiliation() {
56  		empInfos = new ArrayList<PersonDocumentEmploymentInfo>();
57  		setNewEmpInfo(new PersonDocumentEmploymentInfo());
58  		this.active = true;
59  	}
60  
61  	/**
62  	 * @see org.kuali.rice.kim.bo.entity.KimEntityAffiliation#getAffiliationTypeCode()
63  	 */
64  	public String getAffiliationTypeCode() {
65  		if(ObjectUtils.isNull(affiliationTypeCode))
66  			return "";
67  		return affiliationTypeCode;
68  	}
69  
70  	/**
71  	 * @see org.kuali.rice.kim.bo.entity.KimEntityAffiliation#getCampusCode()
72  	 */
73  	public String getCampusCode() {
74  		return campusCode;
75  	}
76  
77  	/**
78  	 * @see org.kuali.rice.kim.bo.entity.KimEntityAffiliation#getEntityAffiliationId()
79  	 */
80  	public String getEntityAffiliationId() {
81  		if(ObjectUtils.isNull(entityAffiliationId))
82  			return "";
83  		return entityAffiliationId;
84  	}
85  
86  	/**
87  	 * @see org.kuali.rice.kim.bo.entity.KimEntityAffiliation#setAffiliationTypeCode(java.lang.String)
88  	 */
89  	public void setAffiliationTypeCode(String affiliationTypeCode) {
90  		this.affiliationTypeCode = affiliationTypeCode;
91  	}
92  
93  	/**
94  	 * @see org.kuali.rice.kim.bo.entity.KimEntityAffiliation#setCampusCode(java.lang.String)
95  	 */
96  	public void setCampusCode(String campusCode) {
97  		this.campusCode = campusCode;
98  	}
99  
100 	/**
101 	 * @see org.kuali.rice.kns.bo.BusinessObjectBase#toStringMapper()
102 	 */
103 	@Override
104 	protected LinkedHashMap toStringMapper() {
105 		LinkedHashMap m = super.toStringMapper();
106 		m.put("entityAffiliationId", entityAffiliationId);
107 		m.put("affiliationTypeCode", affiliationTypeCode);
108 		return m;
109 	}
110 
111 	public void setEntityAffiliationId(String entityAffiliationId) {
112 		this.entityAffiliationId = entityAffiliationId;
113 	}
114 
115 	public PersonDocumentEmploymentInfo getNewEmpInfo() {
116 		return this.newEmpInfo;
117 	}
118 
119 	public void setNewEmpInfo(PersonDocumentEmploymentInfo newEmpInfo) {
120 		this.newEmpInfo = newEmpInfo;
121 	}
122 
123 	public List<PersonDocumentEmploymentInfo> getEmpInfos() {
124 		return this.empInfos;
125 	}
126 
127 	public void setEmpInfos(List<PersonDocumentEmploymentInfo> empInfos) {
128 		this.empInfos = empInfos;
129 	}
130 
131 	public AffiliationTypeImpl getAffiliationType() {
132 		if(ObjectUtils.isNull(affiliationType))
133 			return null;
134 		return this.affiliationType;
135 	}
136 
137 	public boolean isEmploymentAffiliationType() {
138 		if(ObjectUtils.isNull(affiliationType))
139 			return false;
140 		return this.affiliationType.isEmploymentAffiliationType();
141 	}
142 	 
143 	public void setAffiliationType(AffiliationTypeImpl affiliationType) {
144 		this.affiliationType = affiliationType;
145 	}
146 
147 	@Override
148 	public boolean isActive(){
149 		return this.active;
150 	}
151 
152 }