/*
 * 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.util.Collection;
import javax.persistence.CascadeType;
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.OneToMany;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author developer2
 */
@Entity
@Table(name="COMACO.TGENEBATCH")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Tgenebatch.findAll", query = "SELECT t FROM Tgenebatch t"),
    @NamedQuery(name = "Tgenebatch.findByModulecode", query = "SELECT t FROM Tgenebatch t WHERE t.tgenebatchPK.modulecode = :modulecode"),
    @NamedQuery(name = "Tgenebatch.findByTransactionmodule", query = "SELECT t FROM Tgenebatch t WHERE t.tgenebatchPK.transactionmodule = :transactionmodule"),
    @NamedQuery(name = "Tgenebatch.findByTransactioncode", query = "SELECT t FROM Tgenebatch t WHERE t.tgenebatchPK.transactioncode = :transactioncode"),
    @NamedQuery(name = "Tgenebatch.findByTransactionversion", query = "SELECT t FROM Tgenebatch t WHERE t.tgenebatchPK.transactionversion = :transactionversion"),
    @NamedQuery(name = "Tgenebatch.findByActive", query = "SELECT t FROM Tgenebatch t WHERE t.active = :active"),
    @NamedQuery(name = "Tgenebatch.findByProcessorder", query = "SELECT t FROM Tgenebatch t WHERE t.processorder = :processorder"),
    @NamedQuery(name = "Tgenebatch.findByThreads", query = "SELECT t FROM Tgenebatch t WHERE t.threads = :threads")})
public class Tgenebatch implements Serializable {

    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected TgenebatchPK tgenebatchPK;
    @Column(name = "ACTIVE")
    private String active;
    @Column(name = "PROCESSORDER")
    private Short processorder;
    @Column(name = "THREADS")
    private Short threads;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "tgenebatch")
    private Collection<Tgeneaccountbatchprocess> tgeneaccountbatchprocessCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "tgenebatch")
    private Collection<Tgenebatchprocess> tgenebatchprocessCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "tgenebatch")
    private Collection<Tgeneaccobatchpreviousprocess> tgeneaccobatchpreviousprocessCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "tgenebatch")
    private Collection<Tgeneaccountbatchpreviousproce> tgeneaccountbatchpreviousproceCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "tgenebatch")
    private Collection<Tgenebatchpreviousprocess> tgenebatchpreviousprocessCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "tgenebatch")
    private Collection<Tgeneaccountbatchstatus> tgeneaccountbatchstatusCollection;
    @JoinColumn(name = "MODULECODE", referencedColumnName = "MODULECODE", insertable = false, updatable = false)
    @ManyToOne(optional = false)
    private Tgenemodule tgenemodule;
    @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;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "tgenebatch")
    private Collection<Tgenebatchlog> tgenebatchlogCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "tgenebatch")
    private Collection<Tgenebatchlogpreviousprocess> tgenebatchlogpreviousprocessCollection;

    public Tgenebatch() {
    }

    public Tgenebatch(TgenebatchPK tgenebatchPK) {
        this.tgenebatchPK = tgenebatchPK;
    }

    public Tgenebatch(String modulecode, String transactionmodule, short transactioncode, short transactionversion) {
        this.tgenebatchPK = new TgenebatchPK(modulecode, transactionmodule, transactioncode, transactionversion);
    }

    public TgenebatchPK getTgenebatchPK() {
        return tgenebatchPK;
    }

    public void setTgenebatchPK(TgenebatchPK tgenebatchPK) {
        this.tgenebatchPK = tgenebatchPK;
    }

    public String getActive() {
        return active;
    }

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

    public Short getProcessorder() {
        return processorder;
    }

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

    public Short getThreads() {
        return threads;
    }

    public void setThreads(Short threads) {
        this.threads = threads;
    }

    @XmlTransient
    public Collection<Tgeneaccountbatchprocess> getTgeneaccountbatchprocessCollection() {
        return tgeneaccountbatchprocessCollection;
    }

    public void setTgeneaccountbatchprocessCollection(Collection<Tgeneaccountbatchprocess> tgeneaccountbatchprocessCollection) {
        this.tgeneaccountbatchprocessCollection = tgeneaccountbatchprocessCollection;
    }

    @XmlTransient
    public Collection<Tgenebatchprocess> getTgenebatchprocessCollection() {
        return tgenebatchprocessCollection;
    }

    public void setTgenebatchprocessCollection(Collection<Tgenebatchprocess> tgenebatchprocessCollection) {
        this.tgenebatchprocessCollection = tgenebatchprocessCollection;
    }

    @XmlTransient
    public Collection<Tgeneaccobatchpreviousprocess> getTgeneaccobatchpreviousprocessCollection() {
        return tgeneaccobatchpreviousprocessCollection;
    }

    public void setTgeneaccobatchpreviousprocessCollection(Collection<Tgeneaccobatchpreviousprocess> tgeneaccobatchpreviousprocessCollection) {
        this.tgeneaccobatchpreviousprocessCollection = tgeneaccobatchpreviousprocessCollection;
    }

    @XmlTransient
    public Collection<Tgeneaccountbatchpreviousproce> getTgeneaccountbatchpreviousproceCollection() {
        return tgeneaccountbatchpreviousproceCollection;
    }

    public void setTgeneaccountbatchpreviousproceCollection(Collection<Tgeneaccountbatchpreviousproce> tgeneaccountbatchpreviousproceCollection) {
        this.tgeneaccountbatchpreviousproceCollection = tgeneaccountbatchpreviousproceCollection;
    }

    @XmlTransient
    public Collection<Tgenebatchpreviousprocess> getTgenebatchpreviousprocessCollection() {
        return tgenebatchpreviousprocessCollection;
    }

    public void setTgenebatchpreviousprocessCollection(Collection<Tgenebatchpreviousprocess> tgenebatchpreviousprocessCollection) {
        this.tgenebatchpreviousprocessCollection = tgenebatchpreviousprocessCollection;
    }

    @XmlTransient
    public Collection<Tgeneaccountbatchstatus> getTgeneaccountbatchstatusCollection() {
        return tgeneaccountbatchstatusCollection;
    }

    public void setTgeneaccountbatchstatusCollection(Collection<Tgeneaccountbatchstatus> tgeneaccountbatchstatusCollection) {
        this.tgeneaccountbatchstatusCollection = tgeneaccountbatchstatusCollection;
    }

    public Tgenemodule getTgenemodule() {
        return tgenemodule;
    }

    public void setTgenemodule(Tgenemodule tgenemodule) {
        this.tgenemodule = tgenemodule;
    }

    public Tgenetransaction getTgenetransaction() {
        return tgenetransaction;
    }

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

    @XmlTransient
    public Collection<Tgenebatchlog> getTgenebatchlogCollection() {
        return tgenebatchlogCollection;
    }

    public void setTgenebatchlogCollection(Collection<Tgenebatchlog> tgenebatchlogCollection) {
        this.tgenebatchlogCollection = tgenebatchlogCollection;
    }

    @XmlTransient
    public Collection<Tgenebatchlogpreviousprocess> getTgenebatchlogpreviousprocessCollection() {
        return tgenebatchlogpreviousprocessCollection;
    }

    public void setTgenebatchlogpreviousprocessCollection(Collection<Tgenebatchlogpreviousprocess> tgenebatchlogpreviousprocessCollection) {
        this.tgenebatchlogpreviousprocessCollection = tgenebatchlogpreviousprocessCollection;
    }

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

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