/*
 * 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.Basic;
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.TGENEBATCHPROCESS")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Tgenebatchprocess.findAll", query = "SELECT t FROM Tgenebatchprocess t"),
    @NamedQuery(name = "Tgenebatchprocess.findByModulecode", query = "SELECT t FROM Tgenebatchprocess t WHERE t.tgenebatchprocessPK.modulecode = :modulecode"),
    @NamedQuery(name = "Tgenebatchprocess.findByTransactionmodule", query = "SELECT t FROM Tgenebatchprocess t WHERE t.tgenebatchprocessPK.transactionmodule = :transactionmodule"),
    @NamedQuery(name = "Tgenebatchprocess.findByTransactioncode", query = "SELECT t FROM Tgenebatchprocess t WHERE t.tgenebatchprocessPK.transactioncode = :transactioncode"),
    @NamedQuery(name = "Tgenebatchprocess.findByTransactionversion", query = "SELECT t FROM Tgenebatchprocess t WHERE t.tgenebatchprocessPK.transactionversion = :transactionversion"),
    @NamedQuery(name = "Tgenebatchprocess.findByProcesscode", query = "SELECT t FROM Tgenebatchprocess t WHERE t.tgenebatchprocessPK.processcode = :processcode"),
    @NamedQuery(name = "Tgenebatchprocess.findByProcessorder", query = "SELECT t FROM Tgenebatchprocess t WHERE t.processorder = :processorder"),
    @NamedQuery(name = "Tgenebatchprocess.findByActioncode", query = "SELECT t FROM Tgenebatchprocess t WHERE t.actioncode = :actioncode"),
    @NamedQuery(name = "Tgenebatchprocess.findByActive", query = "SELECT t FROM Tgenebatchprocess t WHERE t.active = :active")})
public class Tgenebatchprocess implements Serializable {

    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected TgenebatchprocessPK tgenebatchprocessPK;
    @Column(name = "PROCESSORDER")
    private Short processorder;
    @Basic(optional = false)
    @Column(name = "ACTIONCODE")
    private String actioncode;
    @Column(name = "ACTIVE")
    private String active;
    @JoinColumns({
        @JoinColumn(name = "MODULECODE", referencedColumnName = "MODULECODE", insertable = false, updatable = false),
        @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 Tgenebatch tgenebatch;
    @JoinColumns({
        @JoinColumn(name = "PROCESSCODE", referencedColumnName = "PROCESSCODE", insertable = false, updatable = false),
        @JoinColumn(name = "CATALOGTYPEPROCESS", referencedColumnName = "CATALOGTYPEPROCESS"),
        @JoinColumn(name = "CATALOGCODETYPEPROCESS", referencedColumnName = "CATALOGCODETYPEPROCESS")})
    @ManyToOne(optional = false)
    private Tgeneprocess tgeneprocess;

    public Tgenebatchprocess() {
    }

    public Tgenebatchprocess(TgenebatchprocessPK tgenebatchprocessPK) {
        this.tgenebatchprocessPK = tgenebatchprocessPK;
    }

    public Tgenebatchprocess(TgenebatchprocessPK tgenebatchprocessPK, String actioncode) {
        this.tgenebatchprocessPK = tgenebatchprocessPK;
        this.actioncode = actioncode;
    }

    public Tgenebatchprocess(String modulecode, String transactionmodule, short transactioncode, short transactionversion, String processcode) {
        this.tgenebatchprocessPK = new TgenebatchprocessPK(modulecode, transactionmodule, transactioncode, transactionversion, processcode);
    }

    public TgenebatchprocessPK getTgenebatchprocessPK() {
        return tgenebatchprocessPK;
    }

    public void setTgenebatchprocessPK(TgenebatchprocessPK tgenebatchprocessPK) {
        this.tgenebatchprocessPK = tgenebatchprocessPK;
    }

    public Short getProcessorder() {
        return processorder;
    }

    public void setProcessorder(Short processorder) {
        this.processorder = processorder;
    }

    public String getActioncode() {
        return actioncode;
    }

    public void setActioncode(String actioncode) {
        this.actioncode = actioncode;
    }

    public String getActive() {
        return active;
    }

    public void setActive(String active) {
        this.active = active;
    }

    public Tgenebatch getTgenebatch() {
        return tgenebatch;
    }

    public void setTgenebatch(Tgenebatch tgenebatch) {
        this.tgenebatch = tgenebatch;
    }

    public Tgeneprocess getTgeneprocess() {
        return tgeneprocess;
    }

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

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

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