/*
 * 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.BigInteger;
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.TGENETRANSACTIONPROCESS")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Tgenetransactionprocess.findAll", query = "SELECT t FROM Tgenetransactionprocess t"),
    @NamedQuery(name = "Tgenetransactionprocess.findByTransactionmodule", query = "SELECT t FROM Tgenetransactionprocess t WHERE t.tgenetransactionprocessPK.transactionmodule = :transactionmodule"),
    @NamedQuery(name = "Tgenetransactionprocess.findByTransactioncode", query = "SELECT t FROM Tgenetransactionprocess t WHERE t.tgenetransactionprocessPK.transactioncode = :transactioncode"),
    @NamedQuery(name = "Tgenetransactionprocess.findByTransactionversion", query = "SELECT t FROM Tgenetransactionprocess t WHERE t.tgenetransactionprocessPK.transactionversion = :transactionversion"),
    @NamedQuery(name = "Tgenetransactionprocess.findBySequence", query = "SELECT t FROM Tgenetransactionprocess t WHERE t.tgenetransactionprocessPK.sequence = :sequence"),
    @NamedQuery(name = "Tgenetransactionprocess.findByRecordversion", query = "SELECT t FROM Tgenetransactionprocess t WHERE t.recordversion = :recordversion"),
    @NamedQuery(name = "Tgenetransactionprocess.findByExecutionorder", query = "SELECT t FROM Tgenetransactionprocess t WHERE t.executionorder = :executionorder"),
    @NamedQuery(name = "Tgenetransactionprocess.findByStatus", query = "SELECT t FROM Tgenetransactionprocess t WHERE t.status = :status"),
    @NamedQuery(name = "Tgenetransactionprocess.findByManagecache", query = "SELECT t FROM Tgenetransactionprocess t WHERE t.managecache = :managecache"),
    @NamedQuery(name = "Tgenetransactionprocess.findByIsflow", query = "SELECT t FROM Tgenetransactionprocess t WHERE t.isflow = :isflow"),
    @NamedQuery(name = "Tgenetransactionprocess.findByProcessname", query = "SELECT t FROM Tgenetransactionprocess t WHERE t.processname = :processname"),
    @NamedQuery(name = "Tgenetransactionprocess.findByRulename", query = "SELECT t FROM Tgenetransactionprocess t WHERE t.rulename = :rulename"),
    @NamedQuery(name = "Tgenetransactionprocess.findByFlowmessagecode", query = "SELECT t FROM Tgenetransactionprocess t WHERE t.flowmessagecode = :flowmessagecode"),
    @NamedQuery(name = "Tgenetransactionprocess.findByPackagename", query = "SELECT t FROM Tgenetransactionprocess t WHERE t.packagename = :packagename")})
public class Tgenetransactionprocess implements Serializable {

    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected TgenetransactionprocessPK tgenetransactionprocessPK;
    @Column(name = "RECORDVERSION")
    private BigInteger recordversion;
    @Column(name = "EXECUTIONORDER")
    private Short executionorder;
    @Column(name = "STATUS")
    private String status;
    @Column(name = "MANAGECACHE")
    private String managecache;
    @Column(name = "ISFLOW")
    private String isflow;
    @Column(name = "PROCESSNAME")
    private String processname;
    @Column(name = "RULENAME")
    private String rulename;
    @Column(name = "FLOWMESSAGECODE")
    private String flowmessagecode;
    @Column(name = "PACKAGENAME")
    private String packagename;
    @JoinColumns({
        @JoinColumn(name = "RULECODE", referencedColumnName = "RULECODE"),
        @JoinColumn(name = "COMPANYCODE", referencedColumnName = "COMPANYCODE")})
    @ManyToOne
    private Tbpmrules tbpmrules;
    @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 Tgenetransactionprocess() {
    }

    public Tgenetransactionprocess(TgenetransactionprocessPK tgenetransactionprocessPK) {
        this.tgenetransactionprocessPK = tgenetransactionprocessPK;
    }

    public Tgenetransactionprocess(String transactionmodule, short transactioncode, short transactionversion, short sequence) {
        this.tgenetransactionprocessPK = new TgenetransactionprocessPK(transactionmodule, transactioncode, transactionversion, sequence);
    }

    public TgenetransactionprocessPK getTgenetransactionprocessPK() {
        return tgenetransactionprocessPK;
    }

    public void setTgenetransactionprocessPK(TgenetransactionprocessPK tgenetransactionprocessPK) {
        this.tgenetransactionprocessPK = tgenetransactionprocessPK;
    }

    public BigInteger getRecordversion() {
        return recordversion;
    }

    public void setRecordversion(BigInteger recordversion) {
        this.recordversion = recordversion;
    }

    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 getManagecache() {
        return managecache;
    }

    public void setManagecache(String managecache) {
        this.managecache = managecache;
    }

    public String getIsflow() {
        return isflow;
    }

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

    public String getProcessname() {
        return processname;
    }

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

    public String getRulename() {
        return rulename;
    }

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

    public String getFlowmessagecode() {
        return flowmessagecode;
    }

    public void setFlowmessagecode(String flowmessagecode) {
        this.flowmessagecode = flowmessagecode;
    }

    public String getPackagename() {
        return packagename;
    }

    public void setPackagename(String packagename) {
        this.packagename = packagename;
    }

    public Tbpmrules getTbpmrules() {
        return tbpmrules;
    }

    public void setTbpmrules(Tbpmrules tbpmrules) {
        this.tbpmrules = tbpmrules;
    }

    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 += (tgenetransactionprocessPK != null ? tgenetransactionprocessPK.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 Tgenetransactionprocess)) {
            return false;
        }
        Tgenetransactionprocess other = (Tgenetransactionprocess) object;
        if ((this.tgenetransactionprocessPK == null && other.tgenetransactionprocessPK != null) || (this.tgenetransactionprocessPK != null && !this.tgenetransactionprocessPK.equals(other.tgenetransactionprocessPK))) {
            return false;
        }
        return true;
    }

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