001/**
002 * Copyright 2005-2017 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 */
016package org.kuali.rice.kim.bo.ui;
017
018import javax.persistence.CascadeType;
019import javax.persistence.Column;
020import javax.persistence.Entity;
021import javax.persistence.GeneratedValue;
022import javax.persistence.Id;
023import javax.persistence.JoinColumn;
024import javax.persistence.ManyToOne;
025import javax.persistence.Table;
026
027import org.eclipse.persistence.annotations.JoinFetch;
028import org.eclipse.persistence.annotations.JoinFetchType;
029import org.kuali.rice.kim.impl.identity.email.EntityEmailBo;
030import org.kuali.rice.kim.impl.identity.email.EntityEmailTypeBo;
031import org.kuali.rice.krad.data.jpa.PortableSequenceGenerator;
032
033/**
034 * This is a description of what this class does - shyu don't forget to fill this in. 
035 * 
036 * @author Kuali Rice Team (rice.collab@kuali.org)
037 *
038 */
039@Entity
040@Table(name = "KRIM_PND_EMAIL_MT")
041public class PersonDocumentEmail extends PersonDocumentBoDefaultBase {
042    private static final long serialVersionUID = 1L;
043
044    @PortableSequenceGenerator(name = "KRIM_ENTITY_EMAIL_ID_S")
045    @GeneratedValue(generator = "KRIM_ENTITY_EMAIL_ID_S")
046    @Id
047    @Column(name = "ENTITY_EMAIL_ID")
048    protected String entityEmailId;
049
050    @Column(name = "ENT_TYP_CD")
051    protected String entityTypeCode;
052
053    @Column(name = "EMAIL_TYP_CD")
054    protected String emailTypeCode;
055
056    @Column(name = "EMAIL_ADDR")
057    protected String emailAddress;
058
059    @JoinFetch(value= JoinFetchType.OUTER)
060    @ManyToOne(targetEntity = EntityEmailBo.class, cascade = { CascadeType.REFRESH })
061    @JoinColumn(name = "EMAIL_TYP_CD", referencedColumnName = "ENTITY_EMAIL_ID", insertable = false, updatable = false)
062    protected EntityEmailTypeBo emailType;
063
064    public PersonDocumentEmail() {
065    }
066
067    /**
068         * @see org.kuali.rice.kim.api.identity.email.EntityEmailContract#getEmailAddress()
069         */
070    public String getEmailAddress() {
071        return emailAddress;
072    }
073
074    /**
075         * @see org.kuali.rice.kim.api.identity.email.EntityEmailContract#getEmailType()
076         */
077    public String getEmailTypeCode() {
078        return emailTypeCode;
079    }
080
081    /**
082         * @see org.kuali.rice.kim.api.identity.email.EntityEmailContract#getId()
083         */
084    public String getEntityEmailId() {
085        return entityEmailId;
086    }
087
088    /**
089         * @see org.kuali.rice.kim.api.identity.email.EntityEmailContract#setEmailAddress(java.lang.String)
090         */
091    public void setEmailAddress(String emailAddress) {
092        this.emailAddress = emailAddress;
093    }
094
095    /**
096         * @see org.kuali.rice.kim.api.identity.email.EntityEmailContract#setEmailType(java.lang.String)
097         */
098    public void setEmailTypeCode(String emailTypeCode) {
099        this.emailTypeCode = emailTypeCode;
100    }
101
102    /**
103         * @see org.kuali.rice.kim.bo.entity.KimDefaultableEntityTypeData#getEntityTypeCode()
104         */
105    public String getEntityTypeCode() {
106        return entityTypeCode;
107    }
108
109    /**
110         * @see org.kuali.rice.kim.bo.entity.KimDefaultableEntityTypeData#setEntityTypeCode(java.lang.String)
111         */
112    public void setEntityTypeCode(String entityTypeCode) {
113        this.entityTypeCode = entityTypeCode;
114    }
115
116    public void setEntityEmailId(String entityEmailId) {
117        this.entityEmailId = entityEmailId;
118    }
119
120    public EntityEmailTypeBo getEmailType() {
121        return this.emailType;
122    }
123
124    public void setEmailType(EntityEmailTypeBo emailType) {
125        this.emailType = emailType;
126    }
127}