/*
 * 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.BigDecimal;
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.TCUSTPEOPLEADITIONALDATA")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Tcustpeopleaditionaldata.findAll", query = "SELECT t FROM Tcustpeopleaditionaldata t"),
    @NamedQuery(name = "Tcustpeopleaditionaldata.findByPersoncode", query = "SELECT t FROM Tcustpeopleaditionaldata t WHERE t.tcustpeopleaditionaldataPK.personcode = :personcode"),
    @NamedQuery(name = "Tcustpeopleaditionaldata.findByDateto", query = "SELECT t FROM Tcustpeopleaditionaldata t WHERE t.tcustpeopleaditionaldataPK.dateto = :dateto"),
    @NamedQuery(name = "Tcustpeopleaditionaldata.findByDatefrom", query = "SELECT t FROM Tcustpeopleaditionaldata t WHERE t.datefrom = :datefrom"),
    @NamedQuery(name = "Tcustpeopleaditionaldata.findByRecordversion", query = "SELECT t FROM Tcustpeopleaditionaldata t WHERE t.recordversion = :recordversion"),
    @NamedQuery(name = "Tcustpeopleaditionaldata.findByIdentification", query = "SELECT t FROM Tcustpeopleaditionaldata t WHERE t.identification = :identification"),
    @NamedQuery(name = "Tcustpeopleaditionaldata.findByWorkersnumber", query = "SELECT t FROM Tcustpeopleaditionaldata t WHERE t.workersnumber = :workersnumber"),
    @NamedQuery(name = "Tcustpeopleaditionaldata.findByDependentsnumber", query = "SELECT t FROM Tcustpeopleaditionaldata t WHERE t.dependentsnumber = :dependentsnumber"),
    @NamedQuery(name = "Tcustpeopleaditionaldata.findByIngressusercode", query = "SELECT t FROM Tcustpeopleaditionaldata t WHERE t.ingressusercode = :ingressusercode"),
    @NamedQuery(name = "Tcustpeopleaditionaldata.findByModifyusercode", query = "SELECT t FROM Tcustpeopleaditionaldata t WHERE t.modifyusercode = :modifyusercode"),
    @NamedQuery(name = "Tcustpeopleaditionaldata.findByHomevalue", query = "SELECT t FROM Tcustpeopleaditionaldata t WHERE t.homevalue = :homevalue"),
    @NamedQuery(name = "Tcustpeopleaditionaldata.findByHomeresidencetime", query = "SELECT t FROM Tcustpeopleaditionaldata t WHERE t.homeresidencetime = :homeresidencetime"),
    @NamedQuery(name = "Tcustpeopleaditionaldata.findByMainsourceincomecatalog", query = "SELECT t FROM Tcustpeopleaditionaldata t WHERE t.mainsourceincomecatalog = :mainsourceincomecatalog"),
    @NamedQuery(name = "Tcustpeopleaditionaldata.findByMainsourceincomecatalogcode", query = "SELECT t FROM Tcustpeopleaditionaldata t WHERE t.mainsourceincomecatalogcode = :mainsourceincomecatalogcode")})
public class Tcustpeopleaditionaldata implements Serializable {

    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected TcustpeopleaditionaldataPK tcustpeopleaditionaldataPK;
    @Column(name = "DATEFROM")
    @Temporal(TemporalType.TIMESTAMP)
    private Date datefrom;
    @Column(name = "RECORDVERSION")
    private BigInteger recordversion;
    @Column(name = "IDENTIFICATION")
    private String identification;
    @Column(name = "WORKERSNUMBER")
    private Integer workersnumber;
    @Column(name = "DEPENDENTSNUMBER")
    private Short dependentsnumber;
    @Column(name = "INGRESSUSERCODE")
    private String ingressusercode;
    @Column(name = "MODIFYUSERCODE")
    private String modifyusercode;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Column(name = "HOMEVALUE")
    private BigDecimal homevalue;
    @Column(name = "HOMERESIDENCETIME")
    private Short homeresidencetime;
    @Column(name = "MAINSOURCEINCOMECATALOG")
    private String mainsourceincomecatalog;
    @Column(name = "MAINSOURCEINCOMECATALOGCODE")
    private String mainsourceincomecatalogcode;
    @JoinColumn(name = "PERSONCODE", referencedColumnName = "PERSONCODE", insertable = false, updatable = false)
    @ManyToOne(optional = false)
    private Tcustperson tcustperson;
    @JoinColumns({
        @JoinColumn(name = "IDENTIFICATIONCATALOG", referencedColumnName = "CATALOG"),
        @JoinColumn(name = "IDENTIFICATIONCATALOGCODE", referencedColumnName = "CATALOGCODE")})
    @ManyToOne
    private Tgenecatalogdetail tgenecatalogdetail;
    @JoinColumns({
        @JoinColumn(name = "JOBRELATIONSHIPCATALOG", referencedColumnName = "CATALOG"),
        @JoinColumn(name = "JOBRELATIONSHIPCATALOGCODE", referencedColumnName = "CATALOGCODE")})
    @ManyToOne
    private Tgenecatalogdetail tgenecatalogdetail1;
    @JoinColumns({
        @JoinColumn(name = "HOMETYPECATALOG", referencedColumnName = "CATALOG"),
        @JoinColumn(name = "HOMETYPECATALOGCODE", referencedColumnName = "CATALOGCODE")})
    @ManyToOne
    private Tgenecatalogdetail tgenecatalogdetail2;

    public Tcustpeopleaditionaldata() {
    }

    public Tcustpeopleaditionaldata(TcustpeopleaditionaldataPK tcustpeopleaditionaldataPK) {
        this.tcustpeopleaditionaldataPK = tcustpeopleaditionaldataPK;
    }

    public Tcustpeopleaditionaldata(long personcode, Date dateto) {
        this.tcustpeopleaditionaldataPK = new TcustpeopleaditionaldataPK(personcode, dateto);
    }

    public TcustpeopleaditionaldataPK getTcustpeopleaditionaldataPK() {
        return tcustpeopleaditionaldataPK;
    }

    public void setTcustpeopleaditionaldataPK(TcustpeopleaditionaldataPK tcustpeopleaditionaldataPK) {
        this.tcustpeopleaditionaldataPK = tcustpeopleaditionaldataPK;
    }

    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 String getIdentification() {
        return identification;
    }

    public void setIdentification(String identification) {
        this.identification = identification;
    }

    public Integer getWorkersnumber() {
        return workersnumber;
    }

    public void setWorkersnumber(Integer workersnumber) {
        this.workersnumber = workersnumber;
    }

    public Short getDependentsnumber() {
        return dependentsnumber;
    }

    public void setDependentsnumber(Short dependentsnumber) {
        this.dependentsnumber = dependentsnumber;
    }

    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 BigDecimal getHomevalue() {
        return homevalue;
    }

    public void setHomevalue(BigDecimal homevalue) {
        this.homevalue = homevalue;
    }

    public Short getHomeresidencetime() {
        return homeresidencetime;
    }

    public void setHomeresidencetime(Short homeresidencetime) {
        this.homeresidencetime = homeresidencetime;
    }

    public String getMainsourceincomecatalog() {
        return mainsourceincomecatalog;
    }

    public void setMainsourceincomecatalog(String mainsourceincomecatalog) {
        this.mainsourceincomecatalog = mainsourceincomecatalog;
    }

    public String getMainsourceincomecatalogcode() {
        return mainsourceincomecatalogcode;
    }

    public void setMainsourceincomecatalogcode(String mainsourceincomecatalogcode) {
        this.mainsourceincomecatalogcode = mainsourceincomecatalogcode;
    }

    public Tcustperson getTcustperson() {
        return tcustperson;
    }

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

    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;
    }

    public Tgenecatalogdetail getTgenecatalogdetail2() {
        return tgenecatalogdetail2;
    }

    public void setTgenecatalogdetail2(Tgenecatalogdetail tgenecatalogdetail2) {
        this.tgenecatalogdetail2 = tgenecatalogdetail2;
    }

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

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