/*
 * 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.TGENEACCOBATCHPREVIOUSPROCESS")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Tgeneaccobatchpreviousprocess.findAll", query = "SELECT t FROM Tgeneaccobatchpreviousprocess t"),
    @NamedQuery(name = "Tgeneaccobatchpreviousprocess.findByProcessdate", query = "SELECT t FROM Tgeneaccobatchpreviousprocess t WHERE t.tgeneaccobatchpreviousprocessPK.processdate = :processdate"),
    @NamedQuery(name = "Tgeneaccobatchpreviousprocess.findByJournalid", query = "SELECT t FROM Tgeneaccobatchpreviousprocess t WHERE t.tgeneaccobatchpreviousprocessPK.journalid = :journalid"),
    @NamedQuery(name = "Tgeneaccobatchpreviousprocess.findByModulecode", query = "SELECT t FROM Tgeneaccobatchpreviousprocess t WHERE t.tgeneaccobatchpreviousprocessPK.modulecode = :modulecode"),
    @NamedQuery(name = "Tgeneaccobatchpreviousprocess.findByTransactionmodule", query = "SELECT t FROM Tgeneaccobatchpreviousprocess t WHERE t.tgeneaccobatchpreviousprocessPK.transactionmodule = :transactionmodule"),
    @NamedQuery(name = "Tgeneaccobatchpreviousprocess.findByTransactioncode", query = "SELECT t FROM Tgeneaccobatchpreviousprocess t WHERE t.tgeneaccobatchpreviousprocessPK.transactioncode = :transactioncode"),
    @NamedQuery(name = "Tgeneaccobatchpreviousprocess.findByTransactionversion", query = "SELECT t FROM Tgeneaccobatchpreviousprocess t WHERE t.tgeneaccobatchpreviousprocessPK.transactionversion = :transactionversion"),
    @NamedQuery(name = "Tgeneaccobatchpreviousprocess.findByActioncode", query = "SELECT t FROM Tgeneaccobatchpreviousprocess t WHERE t.actioncode = :actioncode"),
    @NamedQuery(name = "Tgeneaccobatchpreviousprocess.findByResultcode", query = "SELECT t FROM Tgeneaccobatchpreviousprocess t WHERE t.resultcode = :resultcode"),
    @NamedQuery(name = "Tgeneaccobatchpreviousprocess.findByTechnicalmessage", query = "SELECT t FROM Tgeneaccobatchpreviousprocess t WHERE t.technicalmessage = :technicalmessage")})
public class Tgeneaccobatchpreviousprocess implements Serializable {

    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected TgeneaccobatchpreviousprocessPK tgeneaccobatchpreviousprocessPK;
    @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 Tgeneaccobatchpreviousprocess() {
    }

    public Tgeneaccobatchpreviousprocess(TgeneaccobatchpreviousprocessPK tgeneaccobatchpreviousprocessPK) {
        this.tgeneaccobatchpreviousprocessPK = tgeneaccobatchpreviousprocessPK;
    }

    public Tgeneaccobatchpreviousprocess(Date processdate, String journalid, String modulecode, String transactionmodule, short transactioncode, short transactionversion) {
        this.tgeneaccobatchpreviousprocessPK = new TgeneaccobatchpreviousprocessPK(processdate, journalid, modulecode, transactionmodule, transactioncode, transactionversion);
    }

    public TgeneaccobatchpreviousprocessPK getTgeneaccobatchpreviousprocessPK() {
        return tgeneaccobatchpreviousprocessPK;
    }

    public void setTgeneaccobatchpreviousprocessPK(TgeneaccobatchpreviousprocessPK tgeneaccobatchpreviousprocessPK) {
        this.tgeneaccobatchpreviousprocessPK = tgeneaccobatchpreviousprocessPK;
    }

    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 += (tgeneaccobatchpreviousprocessPK != null ? tgeneaccobatchpreviousprocessPK.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 Tgeneaccobatchpreviousprocess)) {
            return false;
        }
        Tgeneaccobatchpreviousprocess other = (Tgeneaccobatchpreviousprocess) object;
        if ((this.tgeneaccobatchpreviousprocessPK == null && other.tgeneaccobatchpreviousprocessPK != null) || (this.tgeneaccobatchpreviousprocessPK != null && !this.tgeneaccobatchpreviousprocessPK.equals(other.tgeneaccobatchpreviousprocessPK))) {
            return false;
        }
        return true;
    }

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