/*
 * 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.TGENEBATCHLOGPREVIOUSPROCESS")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Tgenebatchlogpreviousprocess.findAll", query = "SELECT t FROM Tgenebatchlogpreviousprocess t"),
    @NamedQuery(name = "Tgenebatchlogpreviousprocess.findByProcessdate", query = "SELECT t FROM Tgenebatchlogpreviousprocess t WHERE t.tgenebatchlogpreviousprocessPK.processdate = :processdate"),
    @NamedQuery(name = "Tgenebatchlogpreviousprocess.findByJournalid", query = "SELECT t FROM Tgenebatchlogpreviousprocess t WHERE t.tgenebatchlogpreviousprocessPK.journalid = :journalid"),
    @NamedQuery(name = "Tgenebatchlogpreviousprocess.findByActioncode", query = "SELECT t FROM Tgenebatchlogpreviousprocess t WHERE t.tgenebatchlogpreviousprocessPK.actioncode = :actioncode"),
    @NamedQuery(name = "Tgenebatchlogpreviousprocess.findByModulecode", query = "SELECT t FROM Tgenebatchlogpreviousprocess t WHERE t.tgenebatchlogpreviousprocessPK.modulecode = :modulecode"),
    @NamedQuery(name = "Tgenebatchlogpreviousprocess.findByResultcode", query = "SELECT t FROM Tgenebatchlogpreviousprocess t WHERE t.resultcode = :resultcode"),
    @NamedQuery(name = "Tgenebatchlogpreviousprocess.findByUsermessage", query = "SELECT t FROM Tgenebatchlogpreviousprocess t WHERE t.usermessage = :usermessage")})
public class Tgenebatchlogpreviousprocess implements Serializable {

    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected TgenebatchlogpreviousprocessPK tgenebatchlogpreviousprocessPK;
    @Column(name = "RESULTCODE")
    private String resultcode;
    @Column(name = "USERMESSAGE")
    private String usermessage;
    @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 Tgenebatchlogpreviousprocess() {
    }

    public Tgenebatchlogpreviousprocess(TgenebatchlogpreviousprocessPK tgenebatchlogpreviousprocessPK) {
        this.tgenebatchlogpreviousprocessPK = tgenebatchlogpreviousprocessPK;
    }

    public Tgenebatchlogpreviousprocess(Date processdate, String journalid, String actioncode, String modulecode) {
        this.tgenebatchlogpreviousprocessPK = new TgenebatchlogpreviousprocessPK(processdate, journalid, actioncode, modulecode);
    }

    public TgenebatchlogpreviousprocessPK getTgenebatchlogpreviousprocessPK() {
        return tgenebatchlogpreviousprocessPK;
    }

    public void setTgenebatchlogpreviousprocessPK(TgenebatchlogpreviousprocessPK tgenebatchlogpreviousprocessPK) {
        this.tgenebatchlogpreviousprocessPK = tgenebatchlogpreviousprocessPK;
    }

    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 Tgenebatch getTgenebatch() {
        return tgenebatch;
    }

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

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

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