/*
 * 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 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.TLOGLOADERROR")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Tlogloaderror.findAll", query = "SELECT t FROM Tlogloaderror t"),
    @NamedQuery(name = "Tlogloaderror.findByJournalid", query = "SELECT t FROM Tlogloaderror t WHERE t.tlogloaderrorPK.journalid = :journalid"),
    @NamedQuery(name = "Tlogloaderror.findByLoadsequence", query = "SELECT t FROM Tlogloaderror t WHERE t.tlogloaderrorPK.loadsequence = :loadsequence"),
    @NamedQuery(name = "Tlogloaderror.findByErrorsequence", query = "SELECT t FROM Tlogloaderror t WHERE t.tlogloaderrorPK.errorsequence = :errorsequence"),
    @NamedQuery(name = "Tlogloaderror.findByResultcode", query = "SELECT t FROM Tlogloaderror t WHERE t.resultcode = :resultcode"),
    @NamedQuery(name = "Tlogloaderror.findByMessage", query = "SELECT t FROM Tlogloaderror t WHERE t.message = :message"),
    @NamedQuery(name = "Tlogloaderror.findByIdentifier", query = "SELECT t FROM Tlogloaderror t WHERE t.identifier = :identifier")})
public class Tlogloaderror implements Serializable {

    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected TlogloaderrorPK tlogloaderrorPK;
    @Column(name = "RESULTCODE")
    private String resultcode;
    @Column(name = "MESSAGE")
    private String message;
    @Column(name = "IDENTIFIER")
    private String identifier;
    @JoinColumns({
        @JoinColumn(name = "JOURNALID", referencedColumnName = "JOURNALID", insertable = false, updatable = false),
        @JoinColumn(name = "LOADSEQUENCE", referencedColumnName = "LOADSEQUENCE", insertable = false, updatable = false)})
    @ManyToOne(optional = false)
    private Tlogload tlogload;

    public Tlogloaderror() {
    }

    public Tlogloaderror(TlogloaderrorPK tlogloaderrorPK) {
        this.tlogloaderrorPK = tlogloaderrorPK;
    }

    public Tlogloaderror(String journalid, long loadsequence, short errorsequence) {
        this.tlogloaderrorPK = new TlogloaderrorPK(journalid, loadsequence, errorsequence);
    }

    public TlogloaderrorPK getTlogloaderrorPK() {
        return tlogloaderrorPK;
    }

    public void setTlogloaderrorPK(TlogloaderrorPK tlogloaderrorPK) {
        this.tlogloaderrorPK = tlogloaderrorPK;
    }

    public String getResultcode() {
        return resultcode;
    }

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

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public String getIdentifier() {
        return identifier;
    }

    public void setIdentifier(String identifier) {
        this.identifier = identifier;
    }

    public Tlogload getTlogload() {
        return tlogload;
    }

    public void setTlogload(Tlogload tlogload) {
        this.tlogload = tlogload;
    }

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

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