001 /*
002 * Copyright 2007-2008 The Kuali Foundation
003 *
004 * Licensed under the Educational Community License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 * http://www.opensource.org/licenses/ecl2.php
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016 package org.kuali.rice.kim.bo.entity.impl;
017
018 import java.util.LinkedHashMap;
019
020 import javax.persistence.Column;
021 import javax.persistence.Entity;
022 import javax.persistence.FetchType;
023 import javax.persistence.Id;
024 import javax.persistence.JoinColumn;
025 import javax.persistence.ManyToOne;
026 import javax.persistence.Table;
027
028 import org.kuali.rice.kim.bo.entity.KimEntityAffiliation;
029 import org.kuali.rice.kim.bo.reference.AffiliationType;
030 import org.kuali.rice.kim.bo.reference.impl.AffiliationTypeImpl;
031
032 /**
033 * @author Kuali Rice Team (rice.collab@kuali.org)
034 */
035 @Entity
036 @Table(name = "KRIM_ENTITY_AFLTN_T")
037 public class KimEntityAffiliationImpl extends KimDefaultableEntityDataBase implements KimEntityAffiliation {
038
039 private static final long serialVersionUID = 1L;
040
041 @Id
042 @Column(name = "ENTITY_AFLTN_ID")
043 protected String entityAffiliationId;
044
045 @Column(name = "ENTITY_ID")
046 protected String entityId;
047
048 @Column(name = "AFLTN_TYP_CD")
049 protected String affiliationTypeCode;
050
051 @Column(name = "CAMPUS_CD")
052 protected String campusCode;
053
054 @ManyToOne(targetEntity=AffiliationTypeImpl.class, fetch = FetchType.EAGER, cascade = {})
055 @JoinColumn(name = "AFLTN_TYP_CD", insertable = false, updatable = false)
056 protected AffiliationType affiliationType;
057
058 // Waiting until we pull in from KFS
059 // protected Campus campus;
060
061 /**
062 * @see org.kuali.rice.kim.bo.entity.KimEntityAffiliation#getAffiliationTypeCode()
063 */
064 public String getAffiliationTypeCode() {
065 return affiliationTypeCode;
066 }
067
068 /**
069 * @see org.kuali.rice.kim.bo.entity.KimEntityAffiliation#getCampusCode()
070 */
071 public String getCampusCode() {
072 return campusCode;
073 }
074
075 /**
076 * @see org.kuali.rice.kim.bo.entity.KimEntityAffiliation#getEntityAffiliationId()
077 */
078 public String getEntityAffiliationId() {
079 return entityAffiliationId;
080 }
081
082 /**
083 * @see org.kuali.rice.kim.bo.entity.KimEntityAffiliation#setAffiliationTypeCode(java.lang.String)
084 */
085 public void setAffiliationTypeCode(String affiliationTypeCode) {
086 this.affiliationTypeCode = affiliationTypeCode;
087 }
088
089 /**
090 * @see org.kuali.rice.kim.bo.entity.KimEntityAffiliation#setCampusCode(java.lang.String)
091 */
092 public void setCampusCode(String campusCode) {
093 this.campusCode = campusCode;
094 }
095
096 /**
097 * @see org.kuali.rice.kns.bo.BusinessObjectBase#toStringMapper()
098 */
099 @Override
100 protected LinkedHashMap toStringMapper() {
101 LinkedHashMap m = new LinkedHashMap();
102 m.put("entityAffiliationId", entityAffiliationId);
103 m.put("affiliationTypeCode", affiliationTypeCode);
104 return m;
105 }
106
107 public String getEntityId() {
108 return this.entityId;
109 }
110
111 public void setEntityId(String entityId) {
112 this.entityId = entityId;
113 }
114
115 public AffiliationType getAffiliationType() {
116 return this.affiliationType;
117 }
118
119 public void setAffiliationType(AffiliationType affiliationType) {
120 this.affiliationType = affiliationType;
121 }
122
123 public void setEntityAffiliationId(String entityAffiliationId) {
124 this.entityAffiliationId = entityAffiliationId;
125 }
126
127 }