/*
 * 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_APPLICATIONFILES")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "MdApplicationfiles.findAll", query = "SELECT m FROM MdApplicationfiles m"),
    @NamedQuery(name = "MdApplicationfiles.findById", query = "SELECT m FROM MdApplicationfiles m WHERE m.id = :id"),
    @NamedQuery(name = "MdApplicationfiles.findByName", query = "SELECT m FROM MdApplicationfiles m WHERE m.name = :name"),
    @NamedQuery(name = "MdApplicationfiles.findByUri", query = "SELECT m FROM MdApplicationfiles m WHERE m.uri = :uri"),
    @NamedQuery(name = "MdApplicationfiles.findByType", query = "SELECT m FROM MdApplicationfiles m WHERE m.type = :type"),
    @NamedQuery(name = "MdApplicationfiles.findByState", query = "SELECT m FROM MdApplicationfiles m WHERE m.state = :state"),
    @NamedQuery(name = "MdApplicationfiles.findByLanguage", query = "SELECT m FROM MdApplicationfiles m WHERE m.language = :language"),
    @NamedQuery(name = "MdApplicationfiles.findByLoc", query = "SELECT m FROM MdApplicationfiles m WHERE m.loc = :loc"),
    @NamedQuery(name = "MdApplicationfiles.findBySecurityGroupId", query = "SELECT m FROM MdApplicationfiles m WHERE m.securityGroupId = :securityGroupId"),
    @NamedQuery(name = "MdApplicationfiles.findByCreatedOn", query = "SELECT m FROM MdApplicationfiles m WHERE m.createdOn = :createdOn"),
    @NamedQuery(name = "MdApplicationfiles.findByCreatedBy", query = "SELECT m FROM MdApplicationfiles m WHERE m.createdBy = :createdBy"),
    @NamedQuery(name = "MdApplicationfiles.findByUpdatedOn", query = "SELECT m FROM MdApplicationfiles m WHERE m.updatedOn = :updatedOn"),
    @NamedQuery(name = "MdApplicationfiles.findByUpdatedBy", query = "SELECT m FROM MdApplicationfiles m WHERE m.updatedBy = :updatedBy")})
public class MdApplicationfiles 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;
    @Basic(optional = false)
    @Column(name = "NAME")
    private String name;
    @Basic(optional = false)
    @Column(name = "URI")
    private String uri;
    @Basic(optional = false)
    @Column(name = "TYPE")
    private String type;
    @Basic(optional = false)
    @Column(name = "STATE")
    private String state;
    @Column(name = "LANGUAGE")
    private String language;
    @Column(name = "LOC")
    private BigInteger loc;
    @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 = "UPDATED_ON")
    @Temporal(TemporalType.TIMESTAMP)
    private Date updatedOn;
    @Column(name = "UPDATED_BY")
    private String updatedBy;
    @JoinColumn(name = "APPLICATIONS_ID_FK", referencedColumnName = "ID")
    @ManyToOne(optional = false)
    private MdApplications applicationsIdFk;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "applicationfilesId")
    private Collection<MdFileArtifacts> mdFileArtifactsCollection;

    public MdApplicationfiles() {
    }

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

    public MdApplicationfiles(BigDecimal id, String name, String uri, String type, String state, BigInteger securityGroupId, Date createdOn) {
        this.id = id;
        this.name = name;
        this.uri = uri;
        this.type = type;
        this.state = state;
        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 getUri() {
        return uri;
    }

    public void setUri(String uri) {
        this.uri = uri;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getState() {
        return state;
    }

    public void setState(String state) {
        this.state = state;
    }

    public String getLanguage() {
        return language;
    }

    public void setLanguage(String language) {
        this.language = language;
    }

    public BigInteger getLoc() {
        return loc;
    }

    public void setLoc(BigInteger loc) {
        this.loc = loc;
    }

    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 getUpdatedOn() {
        return updatedOn;
    }

    public void setUpdatedOn(Date updatedOn) {
        this.updatedOn = updatedOn;
    }

    public String getUpdatedBy() {
        return updatedBy;
    }

    public void setUpdatedBy(String updatedBy) {
        this.updatedBy = updatedBy;
    }

    public MdApplications getApplicationsIdFk() {
        return applicationsIdFk;
    }

    public void setApplicationsIdFk(MdApplications applicationsIdFk) {
        this.applicationsIdFk = applicationsIdFk;
    }

    @XmlTransient
    public Collection<MdFileArtifacts> getMdFileArtifactsCollection() {
        return mdFileArtifactsCollection;
    }

    public void setMdFileArtifactsCollection(Collection<MdFileArtifacts> mdFileArtifactsCollection) {
        this.mdFileArtifactsCollection = mdFileArtifactsCollection;
    }

    @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 MdApplicationfiles)) {
            return false;
        }
        MdApplicationfiles other = (MdApplicationfiles) 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.MdApplicationfiles[ id=" + id + " ]";
    }
    
}
