/*
 * 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.util.Collection;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.JoinColumns;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author developer2
 */
@Entity
@Table(name="COMACO.TGENEPROCESS")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Tgeneprocess.findAll", query = "SELECT t FROM Tgeneprocess t"),
    @NamedQuery(name = "Tgeneprocess.findByProcesscode", query = "SELECT t FROM Tgeneprocess t WHERE t.tgeneprocessPK.processcode = :processcode"),
    @NamedQuery(name = "Tgeneprocess.findByCatalogtypeprocess", query = "SELECT t FROM Tgeneprocess t WHERE t.tgeneprocessPK.catalogtypeprocess = :catalogtypeprocess"),
    @NamedQuery(name = "Tgeneprocess.findByCatalogcodetypeprocess", query = "SELECT t FROM Tgeneprocess t WHERE t.tgeneprocessPK.catalogcodetypeprocess = :catalogcodetypeprocess"),
    @NamedQuery(name = "Tgeneprocess.findByDescription", query = "SELECT t FROM Tgeneprocess t WHERE t.description = :description"),
    @NamedQuery(name = "Tgeneprocess.findByShortdesc", query = "SELECT t FROM Tgeneprocess t WHERE t.shortdesc = :shortdesc")})
public class Tgeneprocess implements Serializable {

    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected TgeneprocessPK tgeneprocessPK;
    @Basic(optional = false)
    @Column(name = "DESCRIPTION")
    private String description;
    @Column(name = "SHORTDESC")
    private String shortdesc;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "tgeneprocess")
    private Collection<Tgenebatchprocess> tgenebatchprocessCollection;
    @OneToMany(mappedBy = "tgeneprocess")
    private Collection<Tgenequeryprocess> tgenequeryprocessCollection;
    @OneToMany(mappedBy = "tgeneprocess")
    private Collection<Tgenescheduleprocess> tgenescheduleprocessCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "tgeneprocess")
    private Collection<Tgenebatchpreviousprocess> tgenebatchpreviousprocessCollection;
    @JoinColumns({
        @JoinColumn(name = "CATALOGTYPEPROCESS", referencedColumnName = "CATALOG", insertable = false, updatable = false),
        @JoinColumn(name = "CATALOGCODETYPEPROCESS", referencedColumnName = "CATALOGCODE", insertable = false, updatable = false)})
    @ManyToOne(optional = false)
    private Tgenecatalogdetail tgenecatalogdetail;
    @OneToMany(mappedBy = "tgeneprocess")
    private Collection<Tgenetransactionquery> tgenetransactionqueryCollection;
    @OneToMany(mappedBy = "tgeneprocess")
    private Collection<Tgenetransactionprocess> tgenetransactionprocessCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "tgeneprocess")
    private Collection<Tgeneprocessdesc> tgeneprocessdescCollection;

    public Tgeneprocess() {
    }

    public Tgeneprocess(TgeneprocessPK tgeneprocessPK) {
        this.tgeneprocessPK = tgeneprocessPK;
    }

    public Tgeneprocess(TgeneprocessPK tgeneprocessPK, String description) {
        this.tgeneprocessPK = tgeneprocessPK;
        this.description = description;
    }

    public Tgeneprocess(String processcode, String catalogtypeprocess, String catalogcodetypeprocess) {
        this.tgeneprocessPK = new TgeneprocessPK(processcode, catalogtypeprocess, catalogcodetypeprocess);
    }

    public TgeneprocessPK getTgeneprocessPK() {
        return tgeneprocessPK;
    }

    public void setTgeneprocessPK(TgeneprocessPK tgeneprocessPK) {
        this.tgeneprocessPK = tgeneprocessPK;
    }

    public String getDescription() {
        return description;
    }

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

    public String getShortdesc() {
        return shortdesc;
    }

    public void setShortdesc(String shortdesc) {
        this.shortdesc = shortdesc;
    }

    @XmlTransient
    public Collection<Tgenebatchprocess> getTgenebatchprocessCollection() {
        return tgenebatchprocessCollection;
    }

    public void setTgenebatchprocessCollection(Collection<Tgenebatchprocess> tgenebatchprocessCollection) {
        this.tgenebatchprocessCollection = tgenebatchprocessCollection;
    }

    @XmlTransient
    public Collection<Tgenequeryprocess> getTgenequeryprocessCollection() {
        return tgenequeryprocessCollection;
    }

    public void setTgenequeryprocessCollection(Collection<Tgenequeryprocess> tgenequeryprocessCollection) {
        this.tgenequeryprocessCollection = tgenequeryprocessCollection;
    }

    @XmlTransient
    public Collection<Tgenescheduleprocess> getTgenescheduleprocessCollection() {
        return tgenescheduleprocessCollection;
    }

    public void setTgenescheduleprocessCollection(Collection<Tgenescheduleprocess> tgenescheduleprocessCollection) {
        this.tgenescheduleprocessCollection = tgenescheduleprocessCollection;
    }

    @XmlTransient
    public Collection<Tgenebatchpreviousprocess> getTgenebatchpreviousprocessCollection() {
        return tgenebatchpreviousprocessCollection;
    }

    public void setTgenebatchpreviousprocessCollection(Collection<Tgenebatchpreviousprocess> tgenebatchpreviousprocessCollection) {
        this.tgenebatchpreviousprocessCollection = tgenebatchpreviousprocessCollection;
    }

    public Tgenecatalogdetail getTgenecatalogdetail() {
        return tgenecatalogdetail;
    }

    public void setTgenecatalogdetail(Tgenecatalogdetail tgenecatalogdetail) {
        this.tgenecatalogdetail = tgenecatalogdetail;
    }

    @XmlTransient
    public Collection<Tgenetransactionquery> getTgenetransactionqueryCollection() {
        return tgenetransactionqueryCollection;
    }

    public void setTgenetransactionqueryCollection(Collection<Tgenetransactionquery> tgenetransactionqueryCollection) {
        this.tgenetransactionqueryCollection = tgenetransactionqueryCollection;
    }

    @XmlTransient
    public Collection<Tgenetransactionprocess> getTgenetransactionprocessCollection() {
        return tgenetransactionprocessCollection;
    }

    public void setTgenetransactionprocessCollection(Collection<Tgenetransactionprocess> tgenetransactionprocessCollection) {
        this.tgenetransactionprocessCollection = tgenetransactionprocessCollection;
    }

    @XmlTransient
    public Collection<Tgeneprocessdesc> getTgeneprocessdescCollection() {
        return tgeneprocessdescCollection;
    }

    public void setTgeneprocessdescCollection(Collection<Tgeneprocessdesc> tgeneprocessdescCollection) {
        this.tgeneprocessdescCollection = tgeneprocessdescCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (tgeneprocessPK != null ? tgeneprocessPK.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 Tgeneprocess)) {
            return false;
        }
        Tgeneprocess other = (Tgeneprocess) object;
        if ((this.tgeneprocessPK == null && other.tgeneprocessPK != null) || (this.tgeneprocessPK != null && !this.tgeneprocessPK.equals(other.tgeneprocessPK))) {
            return false;
        }
        return true;
    }

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