/*
 * 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.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author developer2
 */
@Entity
@Table(name="COMACO.TGENSCHEDULEPARAMETERS")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Tgenscheduleparameters.findAll", query = "SELECT t FROM Tgenscheduleparameters t"),
    @NamedQuery(name = "Tgenscheduleparameters.findByCompanycode", query = "SELECT t FROM Tgenscheduleparameters t WHERE t.companycode = :companycode")})
public class Tgenscheduleparameters implements Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "COMPANYCODE")
    private Long companycode;
    @JoinColumns({
        @JoinColumn(name = "COMPANYCODE", referencedColumnName = "COMPANYCODE", insertable = false, updatable = false),
        @JoinColumn(name = "AREACODE", referencedColumnName = "AREACODE")})
    @ManyToOne(optional = false)
    private Tgenearea tgenearea;
    @JoinColumn(name = "CHANNELCODE", referencedColumnName = "CHANNELCODE")
    @ManyToOne
    private Tgenechannels channelcode;
    @JoinColumns({
        @JoinColumn(name = "OFFICECODE", referencedColumnName = "OFFICECODE"),
        @JoinColumn(name = "BRANCHCODE", referencedColumnName = "BRANCHCODE"),
        @JoinColumn(name = "COMPANYCODE", referencedColumnName = "COMPANYCODE", insertable = false, updatable = false)})
    @ManyToOne(optional = false)
    private Tgeneoffice tgeneoffice;
    @JoinColumns({
        @JoinColumn(name = "TERMINALCODE", referencedColumnName = "TERMINALCODE"),
        @JoinColumn(name = "COMPANYCODE", referencedColumnName = "COMPANYCODE", insertable = false, updatable = false)})
    @ManyToOne(optional = false)
    private Tsafeterminal tsafeterminal;
    @JoinColumn(name = "USERCODE", referencedColumnName = "USERCODE")
    @ManyToOne
    private Tsafeuser usercode;

    public Tgenscheduleparameters() {
    }

    public Tgenscheduleparameters(Long companycode) {
        this.companycode = companycode;
    }

    public Long getCompanycode() {
        return companycode;
    }

    public void setCompanycode(Long companycode) {
        this.companycode = companycode;
    }

    public Tgenearea getTgenearea() {
        return tgenearea;
    }

    public void setTgenearea(Tgenearea tgenearea) {
        this.tgenearea = tgenearea;
    }

    public Tgenechannels getChannelcode() {
        return channelcode;
    }

    public void setChannelcode(Tgenechannels channelcode) {
        this.channelcode = channelcode;
    }

    public Tgeneoffice getTgeneoffice() {
        return tgeneoffice;
    }

    public void setTgeneoffice(Tgeneoffice tgeneoffice) {
        this.tgeneoffice = tgeneoffice;
    }

    public Tsafeterminal getTsafeterminal() {
        return tsafeterminal;
    }

    public void setTsafeterminal(Tsafeterminal tsafeterminal) {
        this.tsafeterminal = tsafeterminal;
    }

    public Tsafeuser getUsercode() {
        return usercode;
    }

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

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

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