/*
 * 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.Collection;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author developer2
 */
@Entity
@Table(name="COMACO.TGENESCHEDULEEVENT")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Tgenescheduleevent.findAll", query = "SELECT t FROM Tgenescheduleevent t"),
    @NamedQuery(name = "Tgenescheduleevent.findByEventcode", query = "SELECT t FROM Tgenescheduleevent t WHERE t.eventcode = :eventcode"),
    @NamedQuery(name = "Tgenescheduleevent.findByDescription", query = "SELECT t FROM Tgenescheduleevent t WHERE t.description = :description"),
    @NamedQuery(name = "Tgenescheduleevent.findByExehour", query = "SELECT t FROM Tgenescheduleevent t WHERE t.exehour = :exehour"),
    @NamedQuery(name = "Tgenescheduleevent.findByExeminute", query = "SELECT t FROM Tgenescheduleevent t WHERE t.exeminute = :exeminute"),
    @NamedQuery(name = "Tgenescheduleevent.findByExesecond", query = "SELECT t FROM Tgenescheduleevent t WHERE t.exesecond = :exesecond"),
    @NamedQuery(name = "Tgenescheduleevent.findByBeginweekday", query = "SELECT t FROM Tgenescheduleevent t WHERE t.beginweekday = :beginweekday"),
    @NamedQuery(name = "Tgenescheduleevent.findByEndweekday", query = "SELECT t FROM Tgenescheduleevent t WHERE t.endweekday = :endweekday")})
public class Tgenescheduleevent implements Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "EVENTCODE")
    private String eventcode;
    @Column(name = "DESCRIPTION")
    private String description;
    @Column(name = "EXEHOUR")
    private Short exehour;
    @Column(name = "EXEMINUTE")
    private Short exeminute;
    @Column(name = "EXESECOND")
    private Short exesecond;
    @Column(name = "BEGINWEEKDAY")
    private Short beginweekday;
    @Column(name = "ENDWEEKDAY")
    private Short endweekday;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "tgenescheduleevent")
    private Collection<Tgeneschedulelog> tgeneschedulelogCollection;
    @OneToOne(cascade = CascadeType.ALL, mappedBy = "tgenescheduleevent")
    private Tgenescheduleprocess tgenescheduleprocess;

    public Tgenescheduleevent() {
    }

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

    public String getEventcode() {
        return eventcode;
    }

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

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public Short getExehour() {
        return exehour;
    }

    public void setExehour(Short exehour) {
        this.exehour = exehour;
    }

    public Short getExeminute() {
        return exeminute;
    }

    public void setExeminute(Short exeminute) {
        this.exeminute = exeminute;
    }

    public Short getExesecond() {
        return exesecond;
    }

    public void setExesecond(Short exesecond) {
        this.exesecond = exesecond;
    }

    public Short getBeginweekday() {
        return beginweekday;
    }

    public void setBeginweekday(Short beginweekday) {
        this.beginweekday = beginweekday;
    }

    public Short getEndweekday() {
        return endweekday;
    }

    public void setEndweekday(Short endweekday) {
        this.endweekday = endweekday;
    }

    @XmlTransient
    public Collection<Tgeneschedulelog> getTgeneschedulelogCollection() {
        return tgeneschedulelogCollection;
    }

    public void setTgeneschedulelogCollection(Collection<Tgeneschedulelog> tgeneschedulelogCollection) {
        this.tgeneschedulelogCollection = tgeneschedulelogCollection;
    }

    public Tgenescheduleprocess getTgenescheduleprocess() {
        return tgenescheduleprocess;
    }

    public void setTgenescheduleprocess(Tgenescheduleprocess tgenescheduleprocess) {
        this.tgenescheduleprocess = tgenescheduleprocess;
    }

    @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 Tgenescheduleevent)) {
            return false;
        }
        Tgenescheduleevent other = (Tgenescheduleevent) 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.Tgenescheduleevent[ eventcode=" + eventcode + " ]";
    }
    
}
