All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.denimgroup.threadfix.data.entities.ScheduledEmailReport Maven / Gradle / Ivy

////////////////////////////////////////////////////////////////////////
//
//     Copyright (c) 2009-2016 Denim Group, Ltd.
//
//     The contents of this file are subject to the Mozilla Public 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.mozilla.org/MPL/
//
//     Software distributed under the License is distributed on an "AS IS"
//     basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
//     License for the specific language governing rights and limitations
//     under the License.
//
//     The Original Code is ThreadFix.
//
//     The Initial Developer of the Original Code is Denim Group, Ltd.
//     Portions created by Denim Group, Ltd. are Copyright (C)
//     Denim Group, Ltd. All Rights Reserved.
//
//     Contributor(s): Denim Group, Ltd.
//
////////////////////////////////////////////////////////////////////////

package com.denimgroup.threadfix.data.entities;

import com.denimgroup.threadfix.views.AllViews;
import com.fasterxml.jackson.annotation.JsonView;

import javax.persistence.*;
import java.util.List;

@Entity
@Table(name="ScheduledEmailReport")
public class ScheduledEmailReport extends ScheduledJob {

	private static final long serialVersionUID = 2972698237771512123L;

	private GenericSeverity severityLevel;
    private List emailLists;
	private List emailAddresses;
	private List organizations;

	@ElementCollection
	@Column(name = "emailAddress", length = 128)
	@CollectionTable(name = "ReportEmailAddress", joinColumns = @JoinColumn(name = "ScheduledEmailReportId"), foreignKey = @ForeignKey(name="FKE1CC182CF92BB3A0"))
	@JsonView(Object.class)
	public List getEmailAddresses() {
		return emailAddresses;
	}

	public void setEmailAddresses(List emailAddresses) {
		this.emailAddresses = emailAddresses;
	}

    @ManyToMany
    @JoinTable(name="ScheduledEmailReport_EmailList",
            joinColumns={@JoinColumn(name="scheduledEmailReportId", foreignKey = @ForeignKey(name="FKF557D21EF92BB3A0"))},
            inverseJoinColumns={@JoinColumn(name="emailListId", foreignKey = @ForeignKey(name="FKF557D21E2034FB50"))})
    @JsonView(AllViews.ScheduledEmailReportView.class)
    public List getEmailLists() {
        return emailLists;
    }

    public void setEmailLists(List emailLists) {
        this.emailLists = emailLists;
    }

    @ManyToOne
	@JoinColumn(name = "severityLevelId", foreignKey = @ForeignKey(name="FKB4934523A0ABF57"))
	@JsonView(Object.class)
	public GenericSeverity getSeverityLevel() {
		return severityLevel;
	}

	public void setSeverityLevel(GenericSeverity severityLevel) {
		this.severityLevel = severityLevel;
	}

    @ManyToMany
    @JoinTable(name="ScheduledEmailReport_Organization",
            joinColumns={@JoinColumn(name="scheduledEmailReportId", foreignKey = @ForeignKey(name="FKDA716EFF92BB3A0"))},
            inverseJoinColumns={@JoinColumn(name="organizationId", foreignKey = @ForeignKey(name="FKDA716EF88316300"))})
    @JsonView(AllViews.ScheduledEmailReportView.class)
	public List getOrganizations() {
		return organizations;
	}

	public void setOrganizations(List organizations) {
		this.organizations = organizations;
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy