/*
 * 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.math.BigInteger;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
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.TCUSTSUPERVISOR")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Tcustsupervisor.findAll", query = "SELECT t FROM Tcustsupervisor t"),
    @NamedQuery(name = "Tcustsupervisor.findByPersoncode", query = "SELECT t FROM Tcustsupervisor t WHERE t.personcode = :personcode"),
    @NamedQuery(name = "Tcustsupervisor.findBySupervisorid", query = "SELECT t FROM Tcustsupervisor t WHERE t.supervisorid = :supervisorid"),
    @NamedQuery(name = "Tcustsupervisor.findByPerformance", query = "SELECT t FROM Tcustsupervisor t WHERE t.performance = :performance"),
    @NamedQuery(name = "Tcustsupervisor.findByRecordversion", query = "SELECT t FROM Tcustsupervisor t WHERE t.recordversion = :recordversion")})
public class Tcustsupervisor implements Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "PERSONCODE")
    private Long personcode;
    @Column(name = "SUPERVISORID")
    private String supervisorid;
    @Column(name = "PERFORMANCE")
    private Integer performance;
    @Column(name = "RECORDVERSION")
    private BigInteger recordversion;
    @JoinColumn(name = "PERSONCODE", referencedColumnName = "PERSONCODE", insertable = false, updatable = false)
    @OneToOne(optional = false)
    private Tcustperson tcustperson;
    @JoinColumn(name = "CODEFILE", referencedColumnName = "CODE")
    @ManyToOne
    private Tgenefiles codefile;

    public Tcustsupervisor() {
    }

    public Tcustsupervisor(Long personcode) {
        this.personcode = personcode;
    }

    public Long getPersoncode() {
        return personcode;
    }

    public void setPersoncode(Long personcode) {
        this.personcode = personcode;
    }

    public String getSupervisorid() {
        return supervisorid;
    }

    public void setSupervisorid(String supervisorid) {
        this.supervisorid = supervisorid;
    }

    public Integer getPerformance() {
        return performance;
    }

    public void setPerformance(Integer performance) {
        this.performance = performance;
    }

    public BigInteger getRecordversion() {
        return recordversion;
    }

    public void setRecordversion(BigInteger recordversion) {
        this.recordversion = recordversion;
    }

    public Tcustperson getTcustperson() {
        return tcustperson;
    }

    public void setTcustperson(Tcustperson tcustperson) {
        this.tcustperson = tcustperson;
    }

    public Tgenefiles getCodefile() {
        return codefile;
    }

    public void setCodefile(Tgenefiles codefile) {
        this.codefile = codefile;
    }

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

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