/*
 * 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.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.TGENESCHEDULELOG")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Tgeneschedulelog.findAll", query = "SELECT t FROM Tgeneschedulelog t"),
    @NamedQuery(name = "Tgeneschedulelog.findByEventcode", query = "SELECT t FROM Tgeneschedulelog t WHERE t.tgeneschedulelogPK.eventcode = :eventcode"),
    @NamedQuery(name = "Tgeneschedulelog.findByRealdate", query = "SELECT t FROM Tgeneschedulelog t WHERE t.tgeneschedulelogPK.realdate = :realdate"),
    @NamedQuery(name = "Tgeneschedulelog.findByProcessdate", query = "SELECT t FROM Tgeneschedulelog t WHERE t.processdate = :processdate"),
    @NamedQuery(name = "Tgeneschedulelog.findByResultcode", query = "SELECT t FROM Tgeneschedulelog t WHERE t.resultcode = :resultcode"),
    @NamedQuery(name = "Tgeneschedulelog.findByResultmessage", query = "SELECT t FROM Tgeneschedulelog t WHERE t.resultmessage = :resultmessage")})
public class Tgeneschedulelog implements Serializable {

    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected TgeneschedulelogPK tgeneschedulelogPK;
    @Column(name = "PROCESSDATE")
    @Temporal(TemporalType.TIMESTAMP)
    private Date processdate;
    @Column(name = "RESULTCODE")
    private String resultcode;
    @Column(name = "RESULTMESSAGE")
    private String resultmessage;
    @JoinColumn(name = "EVENTCODE", referencedColumnName = "EVENTCODE", insertable = false, updatable = false)
    @ManyToOne(optional = false)
    private Tgenescheduleevent tgenescheduleevent;
    @JoinColumn(name = "USERCODE", referencedColumnName = "USERCODE")
    @ManyToOne
    private Tsafeuser usercode;

    public Tgeneschedulelog() {
    }

    public Tgeneschedulelog(TgeneschedulelogPK tgeneschedulelogPK) {
        this.tgeneschedulelogPK = tgeneschedulelogPK;
    }

    public Tgeneschedulelog(String eventcode, Date realdate) {
        this.tgeneschedulelogPK = new TgeneschedulelogPK(eventcode, realdate);
    }

    public TgeneschedulelogPK getTgeneschedulelogPK() {
        return tgeneschedulelogPK;
    }

    public void setTgeneschedulelogPK(TgeneschedulelogPK tgeneschedulelogPK) {
        this.tgeneschedulelogPK = tgeneschedulelogPK;
    }

    public Date getProcessdate() {
        return processdate;
    }

    public void setProcessdate(Date processdate) {
        this.processdate = processdate;
    }

    public String getResultcode() {
        return resultcode;
    }

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

    public String getResultmessage() {
        return resultmessage;
    }

    public void setResultmessage(String resultmessage) {
        this.resultmessage = resultmessage;
    }

    public Tgenescheduleevent getTgenescheduleevent() {
        return tgenescheduleevent;
    }

    public void setTgenescheduleevent(Tgenescheduleevent tgenescheduleevent) {
        this.tgenescheduleevent = tgenescheduleevent;
    }

    public Tsafeuser getUsercode() {
        return usercode;
    }

    public void setUsercode(Tsafeuser usercode) {
        this.usercode = usercode;
    }

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

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