/*
 * 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.Collection;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.JoinColumns;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author developer2
 */
@Entity
@Table(name="COMACO.TCUSTPERSONDETAIL")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Tcustpersondetail.findAll", query = "SELECT t FROM Tcustpersondetail t"),
    @NamedQuery(name = "Tcustpersondetail.findByPersoncode", query = "SELECT t FROM Tcustpersondetail t WHERE t.tcustpersondetailPK.personcode = :personcode"),
    @NamedQuery(name = "Tcustpersondetail.findByDateto", query = "SELECT t FROM Tcustpersondetail t WHERE t.tcustpersondetailPK.dateto = :dateto"),
    @NamedQuery(name = "Tcustpersondetail.findByRecordversion", query = "SELECT t FROM Tcustpersondetail t WHERE t.recordversion = :recordversion"),
    @NamedQuery(name = "Tcustpersondetail.findByDatefrom", query = "SELECT t FROM Tcustpersondetail t WHERE t.datefrom = :datefrom"),
    @NamedQuery(name = "Tcustpersondetail.findByName", query = "SELECT t FROM Tcustpersondetail t WHERE t.name = :name"),
    @NamedQuery(name = "Tcustpersondetail.findByNickname", query = "SELECT t FROM Tcustpersondetail t WHERE t.nickname = :nickname"),
    @NamedQuery(name = "Tcustpersondetail.findByIdentification", query = "SELECT t FROM Tcustpersondetail t WHERE t.identification = :identification"),
    @NamedQuery(name = "Tcustpersondetail.findByRegisterdate", query = "SELECT t FROM Tcustpersondetail t WHERE t.registerdate = :registerdate"),
    @NamedQuery(name = "Tcustpersondetail.findByInnerscore", query = "SELECT t FROM Tcustpersondetail t WHERE t.innerscore = :innerscore"),
    @NamedQuery(name = "Tcustpersondetail.findByParthnernumber", query = "SELECT t FROM Tcustpersondetail t WHERE t.parthnernumber = :parthnernumber"),
    @NamedQuery(name = "Tcustpersondetail.findByDateexpidentification", query = "SELECT t FROM Tcustpersondetail t WHERE t.dateexpidentification = :dateexpidentification"),
    @NamedQuery(name = "Tcustpersondetail.findByTaxexempt", query = "SELECT t FROM Tcustpersondetail t WHERE t.taxexempt = :taxexempt"),
    @NamedQuery(name = "Tcustpersondetail.findByIsmigrated", query = "SELECT t FROM Tcustpersondetail t WHERE t.ismigrated = :ismigrated"),
    @NamedQuery(name = "Tcustpersondetail.findBySbsemployee", query = "SELECT t FROM Tcustpersondetail t WHERE t.sbsemployee = :sbsemployee"),
    @NamedQuery(name = "Tcustpersondetail.findBySbsusercode", query = "SELECT t FROM Tcustpersondetail t WHERE t.sbsusercode = :sbsusercode"),
    @NamedQuery(name = "Tcustpersondetail.findByLegalrepresent", query = "SELECT t FROM Tcustpersondetail t WHERE t.legalrepresent = :legalrepresent"),
    @NamedQuery(name = "Tcustpersondetail.findByLegalrepresentidentification", query = "SELECT t FROM Tcustpersondetail t WHERE t.legalrepresentidentification = :legalrepresentidentification"),
    @NamedQuery(name = "Tcustpersondetail.findByPhoto", query = "SELECT t FROM Tcustpersondetail t WHERE t.photo = :photo"),
    @NamedQuery(name = "Tcustpersondetail.findByEconimicact", query = "SELECT t FROM Tcustpersondetail t WHERE t.econimicact = :econimicact")})
public class Tcustpersondetail implements Serializable {

    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected TcustpersondetailPK tcustpersondetailPK;
    @Basic(optional = false)
    @Column(name = "RECORDVERSION")
    private BigInteger recordversion;
    @Basic(optional = false)
    @Column(name = "DATEFROM")
    @Temporal(TemporalType.TIMESTAMP)
    private Date datefrom;
    @Basic(optional = false)
    @Column(name = "NAME")
    private String name;
    @Column(name = "NICKNAME")
    private String nickname;
    @Basic(optional = false)
    @Column(name = "IDENTIFICATION")
    private String identification;
    @Column(name = "REGISTERDATE")
    @Temporal(TemporalType.TIMESTAMP)
    private Date registerdate;
    @Column(name = "INNERSCORE")
    private String innerscore;
    @Column(name = "PARTHNERNUMBER")
    private String parthnernumber;
    @Column(name = "DATEEXPIDENTIFICATION")
    @Temporal(TemporalType.TIMESTAMP)
    private Date dateexpidentification;
    @Column(name = "TAXEXEMPT")
    private String taxexempt;
    @Column(name = "ISMIGRATED")
    private String ismigrated;
    @Column(name = "SBSEMPLOYEE")
    private String sbsemployee;
    @Column(name = "SBSUSERCODE")
    private String sbsusercode;
    @Column(name = "LEGALREPRESENT")
    private String legalrepresent;
    @Column(name = "LEGALREPRESENTIDENTIFICATION")
    private String legalrepresentidentification;
    @Lob
    @Column(name = "SIGN")
    private Serializable sign;
    @Lob
    @Column(name = "PICTURE")
    private Serializable picture;
    @Column(name = "PHOTO")
    private Long photo;
    @Column(name = "ECONIMICACT")
    private String econimicact;
    @JoinColumns({
        @JoinColumn(name = "ECONOMICSECTORCATALOG", referencedColumnName = "CATALOG"),
        @JoinColumn(name = "ECONOMICSECTORCATALOGCODE", referencedColumnName = "CATALOGCODE")})
    @ManyToOne
    private Tgenecatalogdetail tgenecatalogdetail;
    @JoinColumn(name = "PERSONCODE", referencedColumnName = "PERSONCODE", insertable = false, updatable = false)
    @ManyToOne(optional = false)
    private Tcustperson tcustperson;
    @JoinColumn(name = "ACTIVITYCODE", referencedColumnName = "ACTIVITYCODE")
    @ManyToOne
    private Tgeneactivity activitycode;
    @JoinColumns({
        @JoinColumn(name = "IDENTIFICATIONCATALOG", referencedColumnName = "CATALOG"),
        @JoinColumn(name = "IDENTIFICATIONCATALOGCODE", referencedColumnName = "CATALOGCODE")})
    @ManyToOne
    private Tgenecatalogdetail tgenecatalogdetail1;
    @JoinColumns({
        @JoinColumn(name = "CLIENTTYPECATALOG", referencedColumnName = "CATALOG"),
        @JoinColumn(name = "CLIENTTYPECATALOGCODE", referencedColumnName = "CATALOGCODE")})
    @ManyToOne
    private Tgenecatalogdetail tgenecatalogdetail2;
    @JoinColumns({
        @JoinColumn(name = "MILITARYGRADE", referencedColumnName = "CATALOG"),
        @JoinColumn(name = "MILITARYGRADECODE", referencedColumnName = "CATALOGCODE")})
    @ManyToOne
    private Tgenecatalogdetail tgenecatalogdetail3;
    @JoinColumns({
        @JoinColumn(name = "PERSONTYPECATALOG", referencedColumnName = "CATALOG"),
        @JoinColumn(name = "PERSONTYPECATALOGCODE", referencedColumnName = "CATALOGCODE")})
    @ManyToOne
    private Tgenecatalogdetail tgenecatalogdetail4;
    @JoinColumn(name = "LANGUAGECODE", referencedColumnName = "LANGUAGECODE")
    @ManyToOne
    private Tgenelanguage languagecode;
    @JoinColumns({
        @JoinColumn(name = "OFFICECODE", referencedColumnName = "OFFICECODE"),
        @JoinColumn(name = "BRANCHCODE", referencedColumnName = "BRANCHCODE"),
        @JoinColumn(name = "COMPANYCODE", referencedColumnName = "COMPANYCODE")})
    @ManyToOne
    private Tgeneoffice tgeneoffice;
    @JoinColumn(name = "MODIFYUSER", referencedColumnName = "USERCODE")
    @ManyToOne
    private Tsafeuser modifyuser;
    @JoinColumn(name = "INGRESSUSER", referencedColumnName = "USERCODE")
    @ManyToOne
    private Tsafeuser ingressuser;
    @OneToMany(mappedBy = "tcustpersondetail")
    private Collection<Tarmcentrocontrol> tarmcentrocontrolCollection;

    public Tcustpersondetail() {
    }

    public Tcustpersondetail(TcustpersondetailPK tcustpersondetailPK) {
        this.tcustpersondetailPK = tcustpersondetailPK;
    }

    public Tcustpersondetail(TcustpersondetailPK tcustpersondetailPK, BigInteger recordversion, Date datefrom, String name, String identification) {
        this.tcustpersondetailPK = tcustpersondetailPK;
        this.recordversion = recordversion;
        this.datefrom = datefrom;
        this.name = name;
        this.identification = identification;
    }

    public Tcustpersondetail(Long personcode, Date dateto) {
        this.tcustpersondetailPK = new TcustpersondetailPK(personcode, dateto);
    }

    public TcustpersondetailPK getTcustpersondetailPK() {
        return tcustpersondetailPK;
    }

    public void setTcustpersondetailPK(TcustpersondetailPK tcustpersondetailPK) {
        this.tcustpersondetailPK = tcustpersondetailPK;
    }

    public BigInteger getRecordversion() {
        return recordversion;
    }

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

    public Date getDatefrom() {
        return datefrom;
    }

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

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getNickname() {
        return nickname;
    }

    public void setNickname(String nickname) {
        this.nickname = nickname;
    }

    public String getIdentification() {
        return identification;
    }

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

    public Date getRegisterdate() {
        return registerdate;
    }

    public void setRegisterdate(Date registerdate) {
        this.registerdate = registerdate;
    }

    public String getInnerscore() {
        return innerscore;
    }

    public void setInnerscore(String innerscore) {
        this.innerscore = innerscore;
    }

    public String getParthnernumber() {
        return parthnernumber;
    }

    public void setParthnernumber(String parthnernumber) {
        this.parthnernumber = parthnernumber;
    }

    public Date getDateexpidentification() {
        return dateexpidentification;
    }

    public void setDateexpidentification(Date dateexpidentification) {
        this.dateexpidentification = dateexpidentification;
    }

    public String getTaxexempt() {
        return taxexempt;
    }

    public void setTaxexempt(String taxexempt) {
        this.taxexempt = taxexempt;
    }

    public String getIsmigrated() {
        return ismigrated;
    }

    public void setIsmigrated(String ismigrated) {
        this.ismigrated = ismigrated;
    }

    public String getSbsemployee() {
        return sbsemployee;
    }

    public void setSbsemployee(String sbsemployee) {
        this.sbsemployee = sbsemployee;
    }

    public String getSbsusercode() {
        return sbsusercode;
    }

    public void setSbsusercode(String sbsusercode) {
        this.sbsusercode = sbsusercode;
    }

    public String getLegalrepresent() {
        return legalrepresent;
    }

    public void setLegalrepresent(String legalrepresent) {
        this.legalrepresent = legalrepresent;
    }

    public String getLegalrepresentidentification() {
        return legalrepresentidentification;
    }

    public void setLegalrepresentidentification(String legalrepresentidentification) {
        this.legalrepresentidentification = legalrepresentidentification;
    }

    public Serializable getSign() {
        return sign;
    }

    public void setSign(Serializable sign) {
        this.sign = sign;
    }

    public Serializable getPicture() {
        return picture;
    }

    public void setPicture(Serializable picture) {
        this.picture = picture;
    }

    public Long getPhoto() {
        return photo;
    }

    public void setPhoto(Long photo) {
        this.photo = photo;
    }

    public String getEconimicact() {
        return econimicact;
    }

    public void setEconimicact(String econimicact) {
        this.econimicact = econimicact;
    }

    public Tgenecatalogdetail getTgenecatalogdetail() {
        return tgenecatalogdetail;
    }

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

    public Tcustperson getTcustperson() {
        return tcustperson;
    }

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

    public Tgeneactivity getActivitycode() {
        return activitycode;
    }

    public void setActivitycode(Tgeneactivity activitycode) {
        this.activitycode = activitycode;
    }

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

    public Tgenecatalogdetail getTgenecatalogdetail3() {
        return tgenecatalogdetail3;
    }

    public void setTgenecatalogdetail3(Tgenecatalogdetail tgenecatalogdetail3) {
        this.tgenecatalogdetail3 = tgenecatalogdetail3;
    }

    public Tgenecatalogdetail getTgenecatalogdetail4() {
        return tgenecatalogdetail4;
    }

    public void setTgenecatalogdetail4(Tgenecatalogdetail tgenecatalogdetail4) {
        this.tgenecatalogdetail4 = tgenecatalogdetail4;
    }

    public Tgenelanguage getLanguagecode() {
        return languagecode;
    }

    public void setLanguagecode(Tgenelanguage languagecode) {
        this.languagecode = languagecode;
    }

    public Tgeneoffice getTgeneoffice() {
        return tgeneoffice;
    }

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

    public Tsafeuser getModifyuser() {
        return modifyuser;
    }

    public void setModifyuser(Tsafeuser modifyuser) {
        this.modifyuser = modifyuser;
    }

    public Tsafeuser getIngressuser() {
        return ingressuser;
    }

    public void setIngressuser(Tsafeuser ingressuser) {
        this.ingressuser = ingressuser;
    }

    @XmlTransient
    public Collection<Tarmcentrocontrol> getTarmcentrocontrolCollection() {
        return tarmcentrocontrolCollection;
    }

    public void setTarmcentrocontrolCollection(Collection<Tarmcentrocontrol> tarmcentrocontrolCollection) {
        this.tarmcentrocontrolCollection = tarmcentrocontrolCollection;
    }

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

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