/*
 * 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.TGENETRANSACTIONQUERY")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Tgenetransactionquery.findAll", query = "SELECT t FROM Tgenetransactionquery t"),
    @NamedQuery(name = "Tgenetransactionquery.findByTransactionmodule", query = "SELECT t FROM Tgenetransactionquery t WHERE t.tgenetransactionqueryPK.transactionmodule = :transactionmodule"),
    @NamedQuery(name = "Tgenetransactionquery.findByTransactioncode", query = "SELECT t FROM Tgenetransactionquery t WHERE t.tgenetransactionqueryPK.transactioncode = :transactioncode"),
    @NamedQuery(name = "Tgenetransactionquery.findByTransactionversion", query = "SELECT t FROM Tgenetransactionquery t WHERE t.tgenetransactionqueryPK.transactionversion = :transactionversion"),
    @NamedQuery(name = "Tgenetransactionquery.findBySequence", query = "SELECT t FROM Tgenetransactionquery t WHERE t.tgenetransactionqueryPK.sequence = :sequence"),
    @NamedQuery(name = "Tgenetransactionquery.findByExecutionorder", query = "SELECT t FROM Tgenetransactionquery t WHERE t.executionorder = :executionorder"),
    @NamedQuery(name = "Tgenetransactionquery.findByStatus", query = "SELECT t FROM Tgenetransactionquery t WHERE t.status = :status"),
    @NamedQuery(name = "Tgenetransactionquery.findByIsflow", query = "SELECT t FROM Tgenetransactionquery t WHERE t.isflow = :isflow"),
    @NamedQuery(name = "Tgenetransactionquery.findByRulename", query = "SELECT t FROM Tgenetransactionquery t WHERE t.rulename = :rulename"),
    @NamedQuery(name = "Tgenetransactionquery.findByProcessname", query = "SELECT t FROM Tgenetransactionquery t WHERE t.processname = :processname")})
public class Tgenetransactionquery implements Serializable {

    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected TgenetransactionqueryPK tgenetransactionqueryPK;
    @Column(name = "EXECUTIONORDER")
    private Short executionorder;
    @Column(name = "STATUS")
    private String status;
    @Column(name = "ISFLOW")
    private String isflow;
    @Column(name = "RULENAME")
    private String rulename;
    @Column(name = "PROCESSNAME")
    private String processname;
    @JoinColumns({
        @JoinColumn(name = "PROCESSCODE", referencedColumnName = "PROCESSCODE"),
        @JoinColumn(name = "CATALOGTYPEPROCESS", referencedColumnName = "CATALOGTYPEPROCESS"),
        @JoinColumn(name = "CATALOGCODETYPEPROCESS", referencedColumnName = "CATALOGCODETYPEPROCESS")})
    @ManyToOne
    private Tgeneprocess tgeneprocess;
    @JoinColumns({
        @JoinColumn(name = "TRANSACTIONMODULE", referencedColumnName = "TRANSACTIONMODULE", insertable = false, updatable = false),
        @JoinColumn(name = "TRANSACTIONCODE", referencedColumnName = "TRANSACTIONCODE", insertable = false, updatable = false),
        @JoinColumn(name = "TRANSACTIONVERSION", referencedColumnName = "TRANSACTIONVERSION", insertable = false, updatable = false)})
    @ManyToOne(optional = false)
    private Tgenetransaction tgenetransaction;

    public Tgenetransactionquery() {
    }

    public Tgenetransactionquery(TgenetransactionqueryPK tgenetransactionqueryPK) {
        this.tgenetransactionqueryPK = tgenetransactionqueryPK;
    }

    public Tgenetransactionquery(String transactionmodule, short transactioncode, short transactionversion, short sequence) {
        this.tgenetransactionqueryPK = new TgenetransactionqueryPK(transactionmodule, transactioncode, transactionversion, sequence);
    }

    public TgenetransactionqueryPK getTgenetransactionqueryPK() {
        return tgenetransactionqueryPK;
    }

    public void setTgenetransactionqueryPK(TgenetransactionqueryPK tgenetransactionqueryPK) {
        this.tgenetransactionqueryPK = tgenetransactionqueryPK;
    }

    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 String getIsflow() {
        return isflow;
    }

    public void setIsflow(String isflow) {
        this.isflow = isflow;
    }

    public String getRulename() {
        return rulename;
    }

    public void setRulename(String rulename) {
        this.rulename = rulename;
    }

    public String getProcessname() {
        return processname;
    }

    public void setProcessname(String processname) {
        this.processname = processname;
    }

    public Tgeneprocess getTgeneprocess() {
        return tgeneprocess;
    }

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

    public Tgenetransaction getTgenetransaction() {
        return tgenetransaction;
    }

    public void setTgenetransaction(Tgenetransaction tgenetransaction) {
        this.tgenetransaction = tgenetransaction;
    }

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

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