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

com.denimgroup.threadfix.data.entities.cicd.CICDPolicyStatus Maven / Gradle / Ivy

package com.denimgroup.threadfix.data.entities.cicd;

import com.denimgroup.threadfix.data.entities.Application;
import com.denimgroup.threadfix.data.entities.AuditableEntity;
import com.denimgroup.threadfix.data.entities.Snapshot;
import com.denimgroup.threadfix.views.AllViews;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonView;
import org.hibernate.annotations.Cascade;
import org.hibernate.annotations.CascadeType;

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

@Entity
public class CICDPolicyStatus extends AuditableEntity {

    private Application application;
    private List passed;
    private List failed;
    private Date fromDate;
    private Date toDate;
    private boolean passing;
    private Snapshot snapshot;

    @ManyToOne
    @JoinColumn(name = "applicationId")
    @JsonIgnore
    public Application getApplication() {
        return application;
    }

    public void setApplication(Application application) {
        this.application = application;
    }

    @ManyToMany
    @JoinTable(name = "passedMap",
            joinColumns = {@JoinColumn(name = "cicdPolicyStatusId", foreignKey = @ForeignKey(name = "fk_cicdPolicyStatus_passCriteriaSnapshot_cicdPolicyStatusId"))},
            inverseJoinColumns = { @JoinColumn(name = "passedPassCriteriaSnapshotId", foreignKey = @ForeignKey(name = "fk_passCriteriaSnapshot_cicdPolicyStatus_passedPassCriteriaId"))})
    @JsonView({ AllViews.RestViewCICDPolicyStatus.class,AllViews.RestView.class})
    @Cascade(CascadeType.ALL)
    public List getPassed() {
        return passed;
    }

    public void setPassed(List passed) {
        this.passed = passed;
    }

    @ManyToMany
    @JoinTable(name = "failedMap",
            joinColumns = {@JoinColumn(name = "cicdPolicyStatusId", foreignKey = @ForeignKey(name = "fk_cicdPolicyStatus_passCriteriaSnapshot_cicdPolicyStatusId"))},
            inverseJoinColumns = { @JoinColumn(name = "failedPassCriteriaSnapshotId", foreignKey = @ForeignKey(name = "fk_passCriteriaSnapshot_cicdPolicyStatus_failedCriteriaId"))})
    @JsonView({ AllViews.RestViewCICDPolicyStatus.class,AllViews.RestView.class})
    @Cascade(CascadeType.ALL)
    public List getFailed() {
        return failed;
    }

    public void setFailed(List failed) {
        this.failed = failed;
    }

    @Column
    @JsonView(Object.class)
    public boolean isPassing() {
        return passing;
    }

    public void setPassing(boolean passing) {
        this.passing = passing;
    }

    @OneToOne
    @JsonView(Object.class)
    @JoinColumn(name = "snapshotId", foreignKey = @ForeignKey(name="fk_CICDPolicyStatus_Snapshot"))
    public Snapshot getSnapshot() {
        return snapshot;
    }

    public void setSnapshot(Snapshot snapshot) {
        this.snapshot = snapshot;
    }

    @Column
    @JsonView(Object.class)
    public Date getFromDate() {
        return fromDate;
    }

    public void setFromDate(Date fromDate) {
        this.fromDate = fromDate;
    }

    @Column
    @JsonView(Object.class)
    public Date getToDate() {
        return toDate;
    }

    public void setToDate(Date toDate) {
        this.toDate = toDate;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy