/*
 * 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.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author developer2
 */
@Entity
@Table(name="COMACO.TGENEACCOUNTBATCHPREVIOUSPROCE")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Tgeneaccountbatchpreviousproce.findAll", query = "SELECT t FROM Tgeneaccountbatchpreviousproce t"),
    @NamedQuery(name = "Tgeneaccountbatchpreviousproce.findByProcessdate", query = "SELECT t FROM Tgeneaccountbatchpreviousproce t WHERE t.tgeneaccountbatchpreviousprocePK.processdate = :processdate"),
    @NamedQuery(name = "Tgeneaccountbatchpreviousproce.findByJournalid", query = "SELECT t FROM Tgeneaccountbatchpreviousproce t WHERE t.tgeneaccountbatchpreviousprocePK.journalid = :journalid"),
    @NamedQuery(name = "Tgeneaccountbatchpreviousproce.findByModulecode", query = "SELECT t FROM Tgeneaccountbatchpreviousproce t WHERE t.tgeneaccountbatchpreviousprocePK.modulecode = :modulecode"),
    @NamedQuery(name = "Tgeneaccountbatchpreviousproce.findByTransactionmodule", query = "SELECT t FROM Tgeneaccountbatchpreviousproce t WHERE t.tgeneaccountbatchpreviousprocePK.transactionmodule = :transactionmodule"),
    @NamedQuery(name = "Tgeneaccountbatchpreviousproce.findByTransactioncode", query = "SELECT t FROM Tgeneaccountbatchpreviousproce t WHERE t.tgeneaccountbatchpreviousprocePK.transactioncode = :transactioncode"),
    @NamedQuery(name = "Tgeneaccountbatchpreviousproce.findByTransactionversion", query = "SELECT t FROM Tgeneaccountbatchpreviousproce t WHERE t.tgeneaccountbatchpreviousprocePK.transactionversion = :transactionversion"),
    @NamedQuery(name = "Tgeneaccountbatchpreviousproce.findByActioncode", query = "SELECT t FROM Tgeneaccountbatchpreviousproce t WHERE t.actioncode = :actioncode"),
    @NamedQuery(name = "Tgeneaccountbatchpreviousproce.findByResultcode", query = "SELECT t FROM Tgeneaccountbatchpreviousproce t WHERE t.resultcode = :resultcode"),
    @NamedQuery(name = "Tgeneaccountbatchpreviousproce.findByTechnicalmessage", query = "SELECT t FROM Tgeneaccountbatchpreviousproce t WHERE t.technicalmessage = :technicalmessage")})
public class Tgeneaccountbatchpreviousproce implements Serializable {

    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected TgeneaccountbatchpreviousprocePK tgeneaccountbatchpreviousprocePK;
    @Column(name = "ACTIONCODE")
    private String actioncode;
    @Column(name = "RESULTCODE")
    private String resultcode;
    @Column(name = "TECHNICALMESSAGE")
    private String technicalmessage;
    @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 Tgeneaccountbatchpreviousproce() {
    }

    public Tgeneaccountbatchpreviousproce(TgeneaccountbatchpreviousprocePK tgeneaccountbatchpreviousprocePK) {
        this.tgeneaccountbatchpreviousprocePK = tgeneaccountbatchpreviousprocePK;
    }

    public Tgeneaccountbatchpreviousproce(Date processdate, String journalid, String modulecode, String transactionmodule, short transactioncode, short transactionversion) {
        this.tgeneaccountbatchpreviousprocePK = new TgeneaccountbatchpreviousprocePK(processdate, journalid, modulecode, transactionmodule, transactioncode, transactionversion);
    }

    public TgeneaccountbatchpreviousprocePK getTgeneaccountbatchpreviousprocePK() {
        return tgeneaccountbatchpreviousprocePK;
    }

    public void setTgeneaccountbatchpreviousprocePK(TgeneaccountbatchpreviousprocePK tgeneaccountbatchpreviousprocePK) {
        this.tgeneaccountbatchpreviousprocePK = tgeneaccountbatchpreviousprocePK;
    }

    public String getActioncode() {
        return actioncode;
    }

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

    public String getResultcode() {
        return resultcode;
    }

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

    public String getTechnicalmessage() {
        return technicalmessage;
    }

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

    public Tgenebatch getTgenebatch() {
        return tgenebatch;
    }

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

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

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