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

/**
 *
 * @author developer2
 */
@Entity
@Table(name="COMACO.TGENEACCOUNTBATCHSTATUS")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Tgeneaccountbatchstatus.findAll", query = "SELECT t FROM Tgeneaccountbatchstatus t"),
    @NamedQuery(name = "Tgeneaccountbatchstatus.findByAccount", query = "SELECT t FROM Tgeneaccountbatchstatus t WHERE t.tgeneaccountbatchstatusPK.account = :account"),
    @NamedQuery(name = "Tgeneaccountbatchstatus.findByCompany", query = "SELECT t FROM Tgeneaccountbatchstatus t WHERE t.tgeneaccountbatchstatusPK.company = :company"),
    @NamedQuery(name = "Tgeneaccountbatchstatus.findByProcessdate", query = "SELECT t FROM Tgeneaccountbatchstatus t WHERE t.tgeneaccountbatchstatusPK.processdate = :processdate"),
    @NamedQuery(name = "Tgeneaccountbatchstatus.findByModulecode", query = "SELECT t FROM Tgeneaccountbatchstatus t WHERE t.tgeneaccountbatchstatusPK.modulecode = :modulecode"),
    @NamedQuery(name = "Tgeneaccountbatchstatus.findByTransactionmodule", query = "SELECT t FROM Tgeneaccountbatchstatus t WHERE t.tgeneaccountbatchstatusPK.transactionmodule = :transactionmodule"),
    @NamedQuery(name = "Tgeneaccountbatchstatus.findByTransactioncode", query = "SELECT t FROM Tgeneaccountbatchstatus t WHERE t.tgeneaccountbatchstatusPK.transactioncode = :transactioncode"),
    @NamedQuery(name = "Tgeneaccountbatchstatus.findByTransactionversion", query = "SELECT t FROM Tgeneaccountbatchstatus t WHERE t.tgeneaccountbatchstatusPK.transactionversion = :transactionversion"),
    @NamedQuery(name = "Tgeneaccountbatchstatus.findByResultcode", query = "SELECT t FROM Tgeneaccountbatchstatus t WHERE t.resultcode = :resultcode"),
    @NamedQuery(name = "Tgeneaccountbatchstatus.findByUsermessage", query = "SELECT t FROM Tgeneaccountbatchstatus t WHERE t.usermessage = :usermessage"),
    @NamedQuery(name = "Tgeneaccountbatchstatus.findByTechnicalmessage", query = "SELECT t FROM Tgeneaccountbatchstatus t WHERE t.technicalmessage = :technicalmessage"),
    @NamedQuery(name = "Tgeneaccountbatchstatus.findByRealdate", query = "SELECT t FROM Tgeneaccountbatchstatus t WHERE t.realdate = :realdate"),
    @NamedQuery(name = "Tgeneaccountbatchstatus.findByActioncode", query = "SELECT t FROM Tgeneaccountbatchstatus t WHERE t.actioncode = :actioncode")})
public class Tgeneaccountbatchstatus implements Serializable {

    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected TgeneaccountbatchstatusPK tgeneaccountbatchstatusPK;
    @Basic(optional = false)
    @Column(name = "RESULTCODE")
    private String resultcode;
    @Column(name = "USERMESSAGE")
    private String usermessage;
    @Column(name = "TECHNICALMESSAGE")
    private String technicalmessage;
    @Column(name = "REALDATE")
    @Temporal(TemporalType.TIMESTAMP)
    private Date realdate;
    @Column(name = "ACTIONCODE")
    private String actioncode;
    @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 Tgeneaccountbatchstatus() {
    }

    public Tgeneaccountbatchstatus(TgeneaccountbatchstatusPK tgeneaccountbatchstatusPK) {
        this.tgeneaccountbatchstatusPK = tgeneaccountbatchstatusPK;
    }

    public Tgeneaccountbatchstatus(TgeneaccountbatchstatusPK tgeneaccountbatchstatusPK, String resultcode) {
        this.tgeneaccountbatchstatusPK = tgeneaccountbatchstatusPK;
        this.resultcode = resultcode;
    }

    public Tgeneaccountbatchstatus(String account, long company, Date processdate, String modulecode, String transactionmodule, short transactioncode, short transactionversion) {
        this.tgeneaccountbatchstatusPK = new TgeneaccountbatchstatusPK(account, company, processdate, modulecode, transactionmodule, transactioncode, transactionversion);
    }

    public TgeneaccountbatchstatusPK getTgeneaccountbatchstatusPK() {
        return tgeneaccountbatchstatusPK;
    }

    public void setTgeneaccountbatchstatusPK(TgeneaccountbatchstatusPK tgeneaccountbatchstatusPK) {
        this.tgeneaccountbatchstatusPK = tgeneaccountbatchstatusPK;
    }

    public String getResultcode() {
        return resultcode;
    }

    public void setResultcode(String resultcode) {
        this.resultcode = resultcode;
    }

    public String getUsermessage() {
        return usermessage;
    }

    public void setUsermessage(String usermessage) {
        this.usermessage = usermessage;
    }

    public String getTechnicalmessage() {
        return technicalmessage;
    }

    public void setTechnicalmessage(String technicalmessage) {
        this.technicalmessage = technicalmessage;
    }

    public Date getRealdate() {
        return realdate;
    }

    public void setRealdate(Date realdate) {
        this.realdate = realdate;
    }

    public String getActioncode() {
        return actioncode;
    }

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

    public Tgenebatch getTgenebatch() {
        return tgenebatch;
    }

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

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

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