/*
 * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
 * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
 */
package com.qsoft.rs.sincoar.model;

import java.io.Serializable;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.Collection;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author developer2
 */
@Entity
@Table(name="COMACO.MD_APPLICATIONS")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "MdApplications.findAll", query = "SELECT m FROM MdApplications m"),
    @NamedQuery(name = "MdApplications.findById", query = "SELECT m FROM MdApplications m WHERE m.id = :id"),
    @NamedQuery(name = "MdApplications.findByName", query = "SELECT m FROM MdApplications m WHERE m.name = :name"),
    @NamedQuery(name = "MdApplications.findByDescription", query = "SELECT m FROM MdApplications m WHERE m.description = :description"),
    @NamedQuery(name = "MdApplications.findByBaseDir", query = "SELECT m FROM MdApplications m WHERE m.baseDir = :baseDir"),
    @NamedQuery(name = "MdApplications.findByOutputDir", query = "SELECT m FROM MdApplications m WHERE m.outputDir = :outputDir"),
    @NamedQuery(name = "MdApplications.findByBackupDir", query = "SELECT m FROM MdApplications m WHERE m.backupDir = :backupDir"),
    @NamedQuery(name = "MdApplications.findByInplace", query = "SELECT m FROM MdApplications m WHERE m.inplace = :inplace"),
    @NamedQuery(name = "MdApplications.findBySecurityGroupId", query = "SELECT m FROM MdApplications m WHERE m.securityGroupId = :securityGroupId"),
    @NamedQuery(name = "MdApplications.findByCreatedOn", query = "SELECT m FROM MdApplications m WHERE m.createdOn = :createdOn"),
    @NamedQuery(name = "MdApplications.findByCreatedBy", query = "SELECT m FROM MdApplications m WHERE m.createdBy = :createdBy"),
    @NamedQuery(name = "MdApplications.findByLastUpdatedOn", query = "SELECT m FROM MdApplications m WHERE m.lastUpdatedOn = :lastUpdatedOn"),
    @NamedQuery(name = "MdApplications.findByLastUpdatedBy", query = "SELECT m FROM MdApplications m WHERE m.lastUpdatedBy = :lastUpdatedBy")})
public class MdApplications implements Serializable {

    private static final long serialVersionUID = 1L;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Id
    @Basic(optional = false)
    @Column(name = "ID")
    private BigDecimal id;
    @Column(name = "NAME")
    private String name;
    @Column(name = "DESCRIPTION")
    private String description;
    @Column(name = "BASE_DIR")
    private String baseDir;
    @Column(name = "OUTPUT_DIR")
    private String outputDir;
    @Column(name = "BACKUP_DIR")
    private String backupDir;
    @Column(name = "INPLACE")
    private BigInteger inplace;
    @Basic(optional = false)
    @Column(name = "SECURITY_GROUP_ID")
    private BigInteger securityGroupId;
    @Basic(optional = false)
    @Column(name = "CREATED_ON")
    @Temporal(TemporalType.TIMESTAMP)
    private Date createdOn;
    @Column(name = "CREATED_BY")
    private String createdBy;
    @Column(name = "LAST_UPDATED_ON")
    @Temporal(TemporalType.TIMESTAMP)
    private Date lastUpdatedOn;
    @Column(name = "LAST_UPDATED_BY")
    private String lastUpdatedBy;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "applicationsIdFk")
    private Collection<MdApplicationfiles> mdApplicationfilesCollection;
    @JoinColumn(name = "CONNECTION_ID_FK", referencedColumnName = "ID")
    @ManyToOne(optional = false)
    private MdConnections connectionIdFk;

    public MdApplications() {
    }

    public MdApplications(BigDecimal id) {
        this.id = id;
    }

    public MdApplications(BigDecimal id, BigInteger securityGroupId, Date createdOn) {
        this.id = id;
        this.securityGroupId = securityGroupId;
        this.createdOn = createdOn;
    }

    public BigDecimal getId() {
        return id;
    }

    public void setId(BigDecimal id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getBaseDir() {
        return baseDir;
    }

    public void setBaseDir(String baseDir) {
        this.baseDir = baseDir;
    }

    public String getOutputDir() {
        return outputDir;
    }

    public void setOutputDir(String outputDir) {
        this.outputDir = outputDir;
    }

    public String getBackupDir() {
        return backupDir;
    }

    public void setBackupDir(String backupDir) {
        this.backupDir = backupDir;
    }

    public BigInteger getInplace() {
        return inplace;
    }

    public void setInplace(BigInteger inplace) {
        this.inplace = inplace;
    }

    public BigInteger getSecurityGroupId() {
        return securityGroupId;
    }

    public void setSecurityGroupId(BigInteger securityGroupId) {
        this.securityGroupId = securityGroupId;
    }

    public Date getCreatedOn() {
        return createdOn;
    }

    public void setCreatedOn(Date createdOn) {
        this.createdOn = createdOn;
    }

    public String getCreatedBy() {
        return createdBy;
    }

    public void setCreatedBy(String createdBy) {
        this.createdBy = createdBy;
    }

    public Date getLastUpdatedOn() {
        return lastUpdatedOn;
    }

    public void setLastUpdatedOn(Date lastUpdatedOn) {
        this.lastUpdatedOn = lastUpdatedOn;
    }

    public String getLastUpdatedBy() {
        return lastUpdatedBy;
    }

    public void setLastUpdatedBy(String lastUpdatedBy) {
        this.lastUpdatedBy = lastUpdatedBy;
    }

    @XmlTransient
    public Collection<MdApplicationfiles> getMdApplicationfilesCollection() {
        return mdApplicationfilesCollection;
    }

    public void setMdApplicationfilesCollection(Collection<MdApplicationfiles> mdApplicationfilesCollection) {
        this.mdApplicationfilesCollection = mdApplicationfilesCollection;
    }

    public MdConnections getConnectionIdFk() {
        return connectionIdFk;
    }

    public void setConnectionIdFk(MdConnections connectionIdFk) {
        this.connectionIdFk = connectionIdFk;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof MdApplications)) {
            return false;
        }
        MdApplications other = (MdApplications) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.qsoft.rs.sincoar.model.MdApplications[ id=" + id + " ]";
    }
    
}
