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