/*
 * 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 java.util.Date;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
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.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author developer2
 */
@Entity
@Table(name="COMACO.TCUSTPEOPLEJOB")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Tcustpeoplejob.findAll", query = "SELECT t FROM Tcustpeoplejob t"),
    @NamedQuery(name = "Tcustpeoplejob.findByPersoncode", query = "SELECT t FROM Tcustpeoplejob t WHERE t.tcustpeoplejobPK.personcode = :personcode"),
    @NamedQuery(name = "Tcustpeoplejob.findByDateto", query = "SELECT t FROM Tcustpeoplejob t WHERE t.tcustpeoplejobPK.dateto = :dateto"),
    @NamedQuery(name = "Tcustpeoplejob.findByJobsequence", query = "SELECT t FROM Tcustpeoplejob t WHERE t.tcustpeoplejobPK.jobsequence = :jobsequence"),
    @NamedQuery(name = "Tcustpeoplejob.findByDatefrom", query = "SELECT t FROM Tcustpeoplejob t WHERE t.datefrom = :datefrom"),
    @NamedQuery(name = "Tcustpeoplejob.findByRecordversion", query = "SELECT t FROM Tcustpeoplejob t WHERE t.recordversion = :recordversion"),
    @NamedQuery(name = "Tcustpeoplejob.findByEntrydate", query = "SELECT t FROM Tcustpeoplejob t WHERE t.entrydate = :entrydate"),
    @NamedQuery(name = "Tcustpeoplejob.findByDeparturedate", query = "SELECT t FROM Tcustpeoplejob t WHERE t.departuredate = :departuredate"),
    @NamedQuery(name = "Tcustpeoplejob.findByEmployername", query = "SELECT t FROM Tcustpeoplejob t WHERE t.employername = :employername"),
    @NamedQuery(name = "Tcustpeoplejob.findByIsowner", query = "SELECT t FROM Tcustpeoplejob t WHERE t.isowner = :isowner"),
    @NamedQuery(name = "Tcustpeoplejob.findByAddress", query = "SELECT t FROM Tcustpeoplejob t WHERE t.address = :address"),
    @NamedQuery(name = "Tcustpeoplejob.findByIngressusercode", query = "SELECT t FROM Tcustpeoplejob t WHERE t.ingressusercode = :ingressusercode"),
    @NamedQuery(name = "Tcustpeoplejob.findByModifyusercode", query = "SELECT t FROM Tcustpeoplejob t WHERE t.modifyusercode = :modifyusercode")})
public class Tcustpeoplejob implements Serializable {

    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected TcustpeoplejobPK tcustpeoplejobPK;
    @Column(name = "DATEFROM")
    @Temporal(TemporalType.TIMESTAMP)
    private Date datefrom;
    @Column(name = "RECORDVERSION")
    private BigInteger recordversion;
    @Column(name = "ENTRYDATE")
    @Temporal(TemporalType.TIMESTAMP)
    private Date entrydate;
    @Column(name = "DEPARTUREDATE")
    @Temporal(TemporalType.TIMESTAMP)
    private Date departuredate;
    @Column(name = "EMPLOYERNAME")
    private String employername;
    @Column(name = "ISOWNER")
    private String isowner;
    @Column(name = "ADDRESS")
    private Short address;
    @Column(name = "INGRESSUSERCODE")
    private String ingressusercode;
    @Column(name = "MODIFYUSERCODE")
    private String modifyusercode;
    @JoinColumn(name = "PERSONCODE", referencedColumnName = "PERSONCODE", insertable = false, updatable = false)
    @ManyToOne(optional = false)
    private Tcustperson tcustperson;
    @JoinColumn(name = "EMPLOYERPERSONCODE", referencedColumnName = "PERSONCODE")
    @ManyToOne
    private Tcustperson employerpersoncode;
    @JoinColumns({
        @JoinColumn(name = "AGREEMENTTYPECATALOG", referencedColumnName = "CATALOG"),
        @JoinColumn(name = "AGREEMENTTYPECATALOGCODE", referencedColumnName = "CATALOGCODE")})
    @ManyToOne
    private Tgenecatalogdetail tgenecatalogdetail;
    @JoinColumns({
        @JoinColumn(name = "JOBCATALOG", referencedColumnName = "CATALOG"),
        @JoinColumn(name = "JOBCATALOGCODE", referencedColumnName = "CATALOGCODE")})
    @ManyToOne
    private Tgenecatalogdetail tgenecatalogdetail1;

    public Tcustpeoplejob() {
    }

    public Tcustpeoplejob(TcustpeoplejobPK tcustpeoplejobPK) {
        this.tcustpeoplejobPK = tcustpeoplejobPK;
    }

    public Tcustpeoplejob(long personcode, Date dateto, short jobsequence) {
        this.tcustpeoplejobPK = new TcustpeoplejobPK(personcode, dateto, jobsequence);
    }

    public TcustpeoplejobPK getTcustpeoplejobPK() {
        return tcustpeoplejobPK;
    }

    public void setTcustpeoplejobPK(TcustpeoplejobPK tcustpeoplejobPK) {
        this.tcustpeoplejobPK = tcustpeoplejobPK;
    }

    public Date getDatefrom() {
        return datefrom;
    }

    public void setDatefrom(Date datefrom) {
        this.datefrom = datefrom;
    }

    public BigInteger getRecordversion() {
        return recordversion;
    }

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

    public Date getEntrydate() {
        return entrydate;
    }

    public void setEntrydate(Date entrydate) {
        this.entrydate = entrydate;
    }

    public Date getDeparturedate() {
        return departuredate;
    }

    public void setDeparturedate(Date departuredate) {
        this.departuredate = departuredate;
    }

    public String getEmployername() {
        return employername;
    }

    public void setEmployername(String employername) {
        this.employername = employername;
    }

    public String getIsowner() {
        return isowner;
    }

    public void setIsowner(String isowner) {
        this.isowner = isowner;
    }

    public Short getAddress() {
        return address;
    }

    public void setAddress(Short address) {
        this.address = address;
    }

    public String getIngressusercode() {
        return ingressusercode;
    }

    public void setIngressusercode(String ingressusercode) {
        this.ingressusercode = ingressusercode;
    }

    public String getModifyusercode() {
        return modifyusercode;
    }

    public void setModifyusercode(String modifyusercode) {
        this.modifyusercode = modifyusercode;
    }

    public Tcustperson getTcustperson() {
        return tcustperson;
    }

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

    public Tcustperson getEmployerpersoncode() {
        return employerpersoncode;
    }

    public void setEmployerpersoncode(Tcustperson employerpersoncode) {
        this.employerpersoncode = employerpersoncode;
    }

    public Tgenecatalogdetail getTgenecatalogdetail() {
        return tgenecatalogdetail;
    }

    public void setTgenecatalogdetail(Tgenecatalogdetail tgenecatalogdetail) {
        this.tgenecatalogdetail = tgenecatalogdetail;
    }

    public Tgenecatalogdetail getTgenecatalogdetail1() {
        return tgenecatalogdetail1;
    }

    public void setTgenecatalogdetail1(Tgenecatalogdetail tgenecatalogdetail1) {
        this.tgenecatalogdetail1 = tgenecatalogdetail1;
    }

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

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