View Javadoc

1   /*
2    * Copyright 2007-2008 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.LinkedHashMap;
19  
20  import javax.persistence.Column;
21  import javax.persistence.Entity;
22  import javax.persistence.FetchType;
23  import javax.persistence.Id;
24  import javax.persistence.JoinColumn;
25  import javax.persistence.ManyToOne;
26  import javax.persistence.Table;
27  
28  import org.kuali.rice.kim.bo.reference.EmailType;
29  import org.kuali.rice.kim.bo.reference.impl.EmailTypeImpl;
30  
31  /**
32   * This is a description of what this class does - shyu don't forget to fill this in. 
33   * 
34   * @author Kuali Rice Team (rice.collab@kuali.org)
35   *
36   */
37  @Entity
38  @Table(name = "KRIM_PND_EMAIL_MT")
39  public class PersonDocumentEmail extends PersonDocumentBoDefaultBase{
40  	@Id
41  	@Column(name = "ENTITY_EMAIL_ID")
42  	protected String entityEmailId;
43  
44  	@Column(name = "ENT_TYP_CD")
45  	protected String entityTypeCode;
46  
47  	@Column(name = "EMAIL_TYP_CD")
48  	protected String emailTypeCode;
49  
50  	@Column(name = "EMAIL_ADDR")
51  	protected String emailAddress;
52  
53  	@ManyToOne(targetEntity=EmailTypeImpl.class, fetch = FetchType.EAGER, cascade = {})
54  	@JoinColumn(name = "EMAIL_TYP_CD", insertable = false, updatable = false)
55  	protected EmailType emailType;
56  	
57  	public PersonDocumentEmail() {
58  		this.active = true;
59  	}
60  
61  	/**
62  	 * @see org.kuali.rice.kim.bo.entity.KimEntityEmail#getEmailAddress()
63  	 */
64  	public String getEmailAddress() {
65  		return emailAddress;
66  	}
67  
68  	/**
69  	 * @see org.kuali.rice.kim.bo.entity.KimEntityEmail#getEmailTypeCode()
70  	 */
71  	public String getEmailTypeCode() {
72  		return emailTypeCode;
73  	}
74  
75  	/**
76  	 * @see org.kuali.rice.kim.bo.entity.KimEntityEmail#getEntityEmailId()
77  	 */
78  	public String getEntityEmailId() {
79  		return entityEmailId;
80  	}
81  
82  	/**
83  	 * @see org.kuali.rice.kim.bo.entity.KimEntityEmail#setEmailAddress(java.lang.String)
84  	 */
85  	public void setEmailAddress(String emailAddress) {
86  		this.emailAddress = emailAddress;
87  	}
88  
89  	/**
90  	 * @see org.kuali.rice.kim.bo.entity.KimEntityEmail#setEmailTypeCode(java.lang.String)
91  	 */
92  	public void setEmailTypeCode(String emailTypeCode) {
93  		this.emailTypeCode = emailTypeCode;
94  	}
95  
96  	/**
97  	 * @see org.kuali.rice.kim.bo.entity.KimDefaultableEntityTypeData#getEntityTypeCode()
98  	 */
99  	public String getEntityTypeCode() {
100 		return entityTypeCode;
101 	}
102 
103 	/**
104 	 * @see org.kuali.rice.kim.bo.entity.KimDefaultableEntityTypeData#setEntityTypeCode(java.lang.String)
105 	 */
106 	public void setEntityTypeCode(String entityTypeCode) {
107 		this.entityTypeCode = entityTypeCode;
108 	}
109 
110 	/**
111 	 * @see org.kuali.rice.kns.bo.BusinessObjectBase#toStringMapper()
112 	 */
113 	@Override
114 	protected LinkedHashMap toStringMapper() {
115 		LinkedHashMap m = super.toStringMapper();
116 		m.put("entityEmailId", entityEmailId);
117 		m.put("entityTypeCode", entityTypeCode);
118 		m.put("emailTypeCode", emailTypeCode);
119 		return m;
120 	}
121 
122 	public void setEntityEmailId(String entityEmailId) {
123 		this.entityEmailId = entityEmailId;
124 	}
125 
126 	public EmailType getEmailType() {
127 		return this.emailType;
128 	}
129 
130 	public void setEmailType(EmailType emailType) {
131 		this.emailType = emailType;
132 	}
133 
134 	@Override
135 	public boolean isActive(){
136 		return this.active;
137 	}
138 
139 }