/*
 * 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.Date;
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.TGENEACCOUNTBATCHPROCESS")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Tgeneaccountbatchprocess.findAll", query = "SELECT t FROM Tgeneaccountbatchprocess t"),
    @NamedQuery(name = "Tgeneaccountbatchprocess.findByAccount", query = "SELECT t FROM Tgeneaccountbatchprocess t WHERE t.tgeneaccountbatchprocessPK.account = :account"),
    @NamedQuery(name = "Tgeneaccountbatchprocess.findByCompany", query = "SELECT t FROM Tgeneaccountbatchprocess t WHERE t.tgeneaccountbatchprocessPK.company = :company"),
    @NamedQuery(name = "Tgeneaccountbatchprocess.findByProcessdate", query = "SELECT t FROM Tgeneaccountbatchprocess t WHERE t.tgeneaccountbatchprocessPK.processdate = :processdate"),
    @NamedQuery(name = "Tgeneaccountbatchprocess.findByActioncode", query = "SELECT t FROM Tgeneaccountbatchprocess t WHERE t.tgeneaccountbatchprocessPK.actioncode = :actioncode"),
    @NamedQuery(name = "Tgeneaccountbatchprocess.findByModulecode", query = "SELECT t FROM Tgeneaccountbatchprocess t WHERE t.tgeneaccountbatchprocessPK.modulecode = :modulecode"),
    @NamedQuery(name = "Tgeneaccountbatchprocess.findByTransactionmodule", query = "SELECT t FROM Tgeneaccountbatchprocess t WHERE t.tgeneaccountbatchprocessPK.transactionmodule = :transactionmodule"),
    @NamedQuery(name = "Tgeneaccountbatchprocess.findByTransactioncode", query = "SELECT t FROM Tgeneaccountbatchprocess t WHERE t.tgeneaccountbatchprocessPK.transactioncode = :transactioncode"),
    @NamedQuery(name = "Tgeneaccountbatchprocess.findByTransactionversion", query = "SELECT t FROM Tgeneaccountbatchprocess t WHERE t.tgeneaccountbatchprocessPK.transactionversion = :transactionversion")})
public class Tgeneaccountbatchprocess implements Serializable {

    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected TgeneaccountbatchprocessPK tgeneaccountbatchprocessPK;
    @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;

    public Tgeneaccountbatchprocess() {
    }

    public Tgeneaccountbatchprocess(TgeneaccountbatchprocessPK tgeneaccountbatchprocessPK) {
        this.tgeneaccountbatchprocessPK = tgeneaccountbatchprocessPK;
    }

    public Tgeneaccountbatchprocess(String account, long company, Date processdate, String actioncode, String modulecode, String transactionmodule, short transactioncode, short transactionversion) {
        this.tgeneaccountbatchprocessPK = new TgeneaccountbatchprocessPK(account, company, processdate, actioncode, modulecode, transactionmodule, transactioncode, transactionversion);
    }

    public TgeneaccountbatchprocessPK getTgeneaccountbatchprocessPK() {
        return tgeneaccountbatchprocessPK;
    }

    public void setTgeneaccountbatchprocessPK(TgeneaccountbatchprocessPK tgeneaccountbatchprocessPK) {
        this.tgeneaccountbatchprocessPK = tgeneaccountbatchprocessPK;
    }

    public Tgenebatch getTgenebatch() {
        return tgenebatch;
    }

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

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

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