hu.icellmobilsoft.coffee.module.notification.model.EmailRecipient Maven / Gradle / Ivy
/*-
* #%L
* Coffee
* %%
* Copyright (C) 2020 i-Cell Mobilsoft Zrt.
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* #L%
*/
package hu.icellmobilsoft.coffee.module.notification.model;
import javax.enterprise.inject.Vetoed;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import hu.icellmobilsoft.coffee.model.base.AbstractIdentifiedAuditEntity;
import hu.icellmobilsoft.coffee.module.notification.model.enums.RecipientType;
/**
* email recipient table entity
*
* @author imre.scheffer
* @since 1.0.0
*/
@Vetoed
@Entity
@Table(name = "email_recipient")
public class EmailRecipient extends AbstractIdentifiedAuditEntity {
private static final long serialVersionUID = 1L;
/**
* Email FK
*/
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "email_id", nullable = false)
private Email email;
/**
* Recipient FK
*/
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "recipient_id", nullable = false)
private Recipient recipient;
/**
* Recipient type (TO, CC, BCC)
*/
@Column(name = "recipient_type", nullable = false)
@Enumerated(EnumType.STRING)
private RecipientType recipientType;
/**
* Getter for the field {@code email}.
*
* @return {@code email}
*/
public Email getEmail() {
return email;
}
/**
* Setter for the field {@code email}.
*
* @param email
* email to set
*/
public void setEmail(Email email) {
this.email = email;
}
/**
* Getter for the field {@code recipient}.
*
* @return {@code recipient}
*/
public Recipient getRecipient() {
return recipient;
}
/**
* Setter for the field {@code recipient}.
*
* @param recipient
* recipient to set
*/
public void setRecipient(Recipient recipient) {
this.recipient = recipient;
}
/**
* Getter for the field {@code recipientType}.
*
* @return {@code recipientType}
*/
public RecipientType getRecipientType() {
return recipientType;
}
/**
* Setter for the field {@code recipientType}.
*
* @param recipientType
* recipientType to set
*/
public void setRecipientType(RecipientType recipientType) {
this.recipientType = recipientType;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy