/*
 * 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.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.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author developer2
 */
@Entity
@Table(name="COMACO.TGENEBATCHLOG")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Tgenebatchlog.findAll", query = "SELECT t FROM Tgenebatchlog t"),
    @NamedQuery(name = "Tgenebatchlog.findByProcessdate", query = "SELECT t FROM Tgenebatchlog t WHERE t.tgenebatchlogPK.processdate = :processdate"),
    @NamedQuery(name = "Tgenebatchlog.findByJournalid", query = "SELECT t FROM Tgenebatchlog t WHERE t.tgenebatchlogPK.journalid = :journalid"),
    @NamedQuery(name = "Tgenebatchlog.findByModulecode", query = "SELECT t FROM Tgenebatchlog t WHERE t.tgenebatchlogPK.modulecode = :modulecode"),
    @NamedQuery(name = "Tgenebatchlog.findByFinitdate", query = "SELECT t FROM Tgenebatchlog t WHERE t.finitdate = :finitdate"),
    @NamedQuery(name = "Tgenebatchlog.findByFenddate", query = "SELECT t FROM Tgenebatchlog t WHERE t.fenddate = :fenddate"),
    @NamedQuery(name = "Tgenebatchlog.findByTotal", query = "SELECT t FROM Tgenebatchlog t WHERE t.total = :total"),
    @NamedQuery(name = "Tgenebatchlog.findByExecuted", query = "SELECT t FROM Tgenebatchlog t WHERE t.executed = :executed"),
    @NamedQuery(name = "Tgenebatchlog.findByTotalok", query = "SELECT t FROM Tgenebatchlog t WHERE t.totalok = :totalok"),
    @NamedQuery(name = "Tgenebatchlog.findByTotalerror", query = "SELECT t FROM Tgenebatchlog t WHERE t.totalerror = :totalerror")})
public class Tgenebatchlog implements Serializable {

    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected TgenebatchlogPK tgenebatchlogPK;
    @Column(name = "FINITDATE")
    @Temporal(TemporalType.TIMESTAMP)
    private Date finitdate;
    @Column(name = "FENDDATE")
    @Temporal(TemporalType.TIMESTAMP)
    private Date fenddate;
    @Column(name = "TOTAL")
    private Integer total;
    @Column(name = "EXECUTED")
    private Integer executed;
    @Column(name = "TOTALOK")
    private Integer totalok;
    @Column(name = "TOTALERROR")
    private Integer totalerror;
    @JoinColumns({
        @JoinColumn(name = "MODULECODE", referencedColumnName = "MODULECODE", insertable = false, updatable = false),
        @JoinColumn(name = "TRANSACTIONMODULE", referencedColumnName = "TRANSACTIONMODULE"),
        @JoinColumn(name = "TRANSACTIONCODE", referencedColumnName = "TRANSACTIONCODE"),
        @JoinColumn(name = "TRANSACTIONVERSION", referencedColumnName = "TRANSACTIONVERSION")})
    @ManyToOne(optional = false)
    private Tgenebatch tgenebatch;

    public Tgenebatchlog() {
    }

    public Tgenebatchlog(TgenebatchlogPK tgenebatchlogPK) {
        this.tgenebatchlogPK = tgenebatchlogPK;
    }

    public Tgenebatchlog(Date processdate, String journalid, String modulecode) {
        this.tgenebatchlogPK = new TgenebatchlogPK(processdate, journalid, modulecode);
    }

    public TgenebatchlogPK getTgenebatchlogPK() {
        return tgenebatchlogPK;
    }

    public void setTgenebatchlogPK(TgenebatchlogPK tgenebatchlogPK) {
        this.tgenebatchlogPK = tgenebatchlogPK;
    }

    public Date getFinitdate() {
        return finitdate;
    }

    public void setFinitdate(Date finitdate) {
        this.finitdate = finitdate;
    }

    public Date getFenddate() {
        return fenddate;
    }

    public void setFenddate(Date fenddate) {
        this.fenddate = fenddate;
    }

    public Integer getTotal() {
        return total;
    }

    public void setTotal(Integer total) {
        this.total = total;
    }

    public Integer getExecuted() {
        return executed;
    }

    public void setExecuted(Integer executed) {
        this.executed = executed;
    }

    public Integer getTotalok() {
        return totalok;
    }

    public void setTotalok(Integer totalok) {
        this.totalok = totalok;
    }

    public Integer getTotalerror() {
        return totalerror;
    }

    public void setTotalerror(Integer totalerror) {
        this.totalerror = totalerror;
    }

    public Tgenebatch getTgenebatch() {
        return tgenebatch;
    }

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

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

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