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

    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected TgenebatchpreviousprocessPK tgenebatchpreviousprocessPK;
    @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 Tgenebatchpreviousprocess() {
    }

    public Tgenebatchpreviousprocess(TgenebatchpreviousprocessPK tgenebatchpreviousprocessPK) {
        this.tgenebatchpreviousprocessPK = tgenebatchpreviousprocessPK;
    }

    public Tgenebatchpreviousprocess(TgenebatchpreviousprocessPK tgenebatchpreviousprocessPK, String actioncode) {
        this.tgenebatchpreviousprocessPK = tgenebatchpreviousprocessPK;
        this.actioncode = actioncode;
    }

    public Tgenebatchpreviousprocess(String modulecode, String transactionmodule, short transactioncode, short transactionversion, String processcode) {
        this.tgenebatchpreviousprocessPK = new TgenebatchpreviousprocessPK(modulecode, transactionmodule, transactioncode, transactionversion, processcode);
    }

    public TgenebatchpreviousprocessPK getTgenebatchpreviousprocessPK() {
        return tgenebatchpreviousprocessPK;
    }

    public void setTgenebatchpreviousprocessPK(TgenebatchpreviousprocessPK tgenebatchpreviousprocessPK) {
        this.tgenebatchpreviousprocessPK = tgenebatchpreviousprocessPK;
    }

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

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