/*
 * 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.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinColumns;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author developer2
 */
@Entity
@Table(name="COMACO.TGENESCHEDULEPROCESS")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Tgenescheduleprocess.findAll", query = "SELECT t FROM Tgenescheduleprocess t"),
    @NamedQuery(name = "Tgenescheduleprocess.findByEventcode", query = "SELECT t FROM Tgenescheduleprocess t WHERE t.eventcode = :eventcode")})
public class Tgenescheduleprocess implements Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "EVENTCODE")
    private String eventcode;
    @JoinColumns({
        @JoinColumn(name = "PROCESSCODE", referencedColumnName = "PROCESSCODE"),
        @JoinColumn(name = "CATALOGTYPEPROCESS", referencedColumnName = "CATALOGTYPEPROCESS"),
        @JoinColumn(name = "CATALOGCODETYPEPROCESS", referencedColumnName = "CATALOGCODETYPEPROCESS")})
    @ManyToOne
    private Tgeneprocess tgeneprocess;
    @JoinColumn(name = "EVENTCODE", referencedColumnName = "EVENTCODE", insertable = false, updatable = false)
    @OneToOne(optional = false)
    private Tgenescheduleevent tgenescheduleevent;
    @JoinColumns({
        @JoinColumn(name = "TRANSACTIONMODULE", referencedColumnName = "TRANSACTIONMODULE"),
        @JoinColumn(name = "TRANSACTIONCODE", referencedColumnName = "TRANSACTIONCODE"),
        @JoinColumn(name = "TRANSACTIONVERSION", referencedColumnName = "TRANSACTIONVERSION")})
    @ManyToOne
    private Tgenetransaction tgenetransaction;

    public Tgenescheduleprocess() {
    }

    public Tgenescheduleprocess(String eventcode) {
        this.eventcode = eventcode;
    }

    public String getEventcode() {
        return eventcode;
    }

    public void setEventcode(String eventcode) {
        this.eventcode = eventcode;
    }

    public Tgeneprocess getTgeneprocess() {
        return tgeneprocess;
    }

    public void setTgeneprocess(Tgeneprocess tgeneprocess) {
        this.tgeneprocess = tgeneprocess;
    }

    public Tgenescheduleevent getTgenescheduleevent() {
        return tgenescheduleevent;
    }

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

    public Tgenetransaction getTgenetransaction() {
        return tgenetransaction;
    }

    public void setTgenetransaction(Tgenetransaction tgenetransaction) {
        this.tgenetransaction = tgenetransaction;
    }

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

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