/*
 * 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 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.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author developer2
 */
@Entity
@Table(name="COMACO.TGENEQUERYPROCESS")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Tgenequeryprocess.findAll", query = "SELECT t FROM Tgenequeryprocess t"),
    @NamedQuery(name = "Tgenequeryprocess.findByQuerycode", query = "SELECT t FROM Tgenequeryprocess t WHERE t.tgenequeryprocessPK.querycode = :querycode"),
    @NamedQuery(name = "Tgenequeryprocess.findBySequence", query = "SELECT t FROM Tgenequeryprocess t WHERE t.tgenequeryprocessPK.sequence = :sequence"),
    @NamedQuery(name = "Tgenequeryprocess.findByExecutionorder", query = "SELECT t FROM Tgenequeryprocess t WHERE t.executionorder = :executionorder"),
    @NamedQuery(name = "Tgenequeryprocess.findByStatus", query = "SELECT t FROM Tgenequeryprocess t WHERE t.status = :status")})
public class Tgenequeryprocess implements Serializable {

    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected TgenequeryprocessPK tgenequeryprocessPK;
    @Column(name = "EXECUTIONORDER")
    private Short executionorder;
    @Column(name = "STATUS")
    private String status;
    @JoinColumns({
        @JoinColumn(name = "PROCESSCODE", referencedColumnName = "PROCESSCODE"),
        @JoinColumn(name = "CATALOGTYPEPROCESS", referencedColumnName = "CATALOGTYPEPROCESS"),
        @JoinColumn(name = "CATALOGCODETYPEPROCESS", referencedColumnName = "CATALOGCODETYPEPROCESS")})
    @ManyToOne
    private Tgeneprocess tgeneprocess;

    public Tgenequeryprocess() {
    }

    public Tgenequeryprocess(TgenequeryprocessPK tgenequeryprocessPK) {
        this.tgenequeryprocessPK = tgenequeryprocessPK;
    }

    public Tgenequeryprocess(String querycode, short sequence) {
        this.tgenequeryprocessPK = new TgenequeryprocessPK(querycode, sequence);
    }

    public TgenequeryprocessPK getTgenequeryprocessPK() {
        return tgenequeryprocessPK;
    }

    public void setTgenequeryprocessPK(TgenequeryprocessPK tgenequeryprocessPK) {
        this.tgenequeryprocessPK = tgenequeryprocessPK;
    }

    public Short getExecutionorder() {
        return executionorder;
    }

    public void setExecutionorder(Short executionorder) {
        this.executionorder = executionorder;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public Tgeneprocess getTgeneprocess() {
        return tgeneprocess;
    }

    public void setTgeneprocess(Tgeneprocess tgeneprocess) {
        this.tgeneprocess = tgeneprocess;
    }

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

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