/*
 * 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.TCUSTPEOPLE")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Tcustpeople.findAll", query = "SELECT t FROM Tcustpeople t"),
    @NamedQuery(name = "Tcustpeople.findByPersoncode", query = "SELECT t FROM Tcustpeople t WHERE t.tcustpeoplePK.personcode = :personcode"),
    @NamedQuery(name = "Tcustpeople.findByDateto", query = "SELECT t FROM Tcustpeople t WHERE t.tcustpeoplePK.dateto = :dateto"),
    @NamedQuery(name = "Tcustpeople.findByDatefrom", query = "SELECT t FROM Tcustpeople t WHERE t.datefrom = :datefrom"),
    @NamedQuery(name = "Tcustpeople.findByRecordversion", query = "SELECT t FROM Tcustpeople t WHERE t.recordversion = :recordversion"),
    @NamedQuery(name = "Tcustpeople.findByLastname", query = "SELECT t FROM Tcustpeople t WHERE t.lastname = :lastname"),
    @NamedQuery(name = "Tcustpeople.findBySurename", query = "SELECT t FROM Tcustpeople t WHERE t.surename = :surename"),
    @NamedQuery(name = "Tcustpeople.findByFirstname", query = "SELECT t FROM Tcustpeople t WHERE t.firstname = :firstname"),
    @NamedQuery(name = "Tcustpeople.findByMiddlename", query = "SELECT t FROM Tcustpeople t WHERE t.middlename = :middlename"),
    @NamedQuery(name = "Tcustpeople.findByMaritalname", query = "SELECT t FROM Tcustpeople t WHERE t.maritalname = :maritalname"),
    @NamedQuery(name = "Tcustpeople.findByGender", query = "SELECT t FROM Tcustpeople t WHERE t.gender = :gender"),
    @NamedQuery(name = "Tcustpeople.findByBirthdate", query = "SELECT t FROM Tcustpeople t WHERE t.birthdate = :birthdate"),
    @NamedQuery(name = "Tcustpeople.findByIngressusercode", query = "SELECT t FROM Tcustpeople t WHERE t.ingressusercode = :ingressusercode"),
    @NamedQuery(name = "Tcustpeople.findByModifyusercode", query = "SELECT t FROM Tcustpeople t WHERE t.modifyusercode = :modifyusercode"),
    @NamedQuery(name = "Tcustpeople.findByCodigosib", query = "SELECT t FROM Tcustpeople t WHERE t.codigosib = :codigosib"),
    @NamedQuery(name = "Tcustpeople.findByHeight", query = "SELECT t FROM Tcustpeople t WHERE t.height = :height")})
public class Tcustpeople implements Serializable {

    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected TcustpeoplePK tcustpeoplePK;
    @Column(name = "DATEFROM")
    @Temporal(TemporalType.TIMESTAMP)
    private Date datefrom;
    @Column(name = "RECORDVERSION")
    private BigInteger recordversion;
    @Column(name = "LASTNAME")
    private String lastname;
    @Column(name = "SURENAME")
    private String surename;
    @Column(name = "FIRSTNAME")
    private String firstname;
    @Column(name = "MIDDLENAME")
    private String middlename;
    @Column(name = "MARITALNAME")
    private String maritalname;
    @Column(name = "GENDER")
    private String gender;
    @Column(name = "BIRTHDATE")
    @Temporal(TemporalType.TIMESTAMP)
    private Date birthdate;
    @Column(name = "INGRESSUSERCODE")
    private String ingressusercode;
    @Column(name = "MODIFYUSERCODE")
    private String modifyusercode;
    @Column(name = "CODIGOSIB")
    private Integer codigosib;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Column(name = "HEIGHT")
    private BigDecimal height;
    @JoinColumn(name = "PERSONCODE", referencedColumnName = "PERSONCODE", insertable = false, updatable = false)
    @ManyToOne(optional = false)
    private Tcustperson tcustperson;
    @JoinColumns({
        @JoinColumn(name = "EDUCATIONLEVELCATALOG", referencedColumnName = "CATALOG"),
        @JoinColumn(name = "EDUCATIONLEVELCATALOGCODE", referencedColumnName = "CATALOGCODE")})
    @ManyToOne
    private Tgenecatalogdetail tgenecatalogdetail;
    @JoinColumns({
        @JoinColumn(name = "PROFESSIONCATALOG", referencedColumnName = "CATALOG"),
        @JoinColumn(name = "PROFESSIONCATALOGCODE", referencedColumnName = "CATALOGCODE")})
    @ManyToOne
    private Tgenecatalogdetail tgenecatalogdetail1;
    @JoinColumns({
        @JoinColumn(name = "MARITALSTATUSCATALOG", referencedColumnName = "CATALOG"),
        @JoinColumn(name = "MARITALSTATUSCATALOGCODE", referencedColumnName = "CATALOGCODE")})
    @ManyToOne
    private Tgenecatalogdetail tgenecatalogdetail2;
    @JoinColumns({
        @JoinColumn(name = "NOTACTIVITYCATALOG", referencedColumnName = "CATALOG"),
        @JoinColumn(name = "NOTACTIVITYCATALOGCODE", referencedColumnName = "CATALOGCODE")})
    @ManyToOne
    private Tgenecatalogdetail tgenecatalogdetail3;
    @JoinColumns({
        @JoinColumn(name = "BIRTHCOUNTRYCODE", referencedColumnName = "COUNTRYCODE"),
        @JoinColumn(name = "BIRTHPROVINCECODE", referencedColumnName = "PROVINCECODE"),
        @JoinColumn(name = "BIRTHCANTONCODE", referencedColumnName = "CANTONCODE"),
        @JoinColumn(name = "BIRTHCITYCODE", referencedColumnName = "CITYCODE")})
    @ManyToOne
    private Tgenecity tgenecity;
    @JoinColumn(name = "NACIONALITY", referencedColumnName = "COUNTRYCODE")
    @ManyToOne
    private Tgenecountry nacionality;
    @JoinColumn(name = "SIGNATURECODE", referencedColumnName = "CODE")
    @ManyToOne
    private Tgenefiles signaturecode;
    @JoinColumn(name = "PHOTOCODE", referencedColumnName = "CODE")
    @ManyToOne
    private Tgenefiles photocode;
    @JoinColumns({
        @JoinColumn(name = "BIRTHCOUNTRYCODE", referencedColumnName = "COUNTRYCODE"),
        @JoinColumn(name = "BIRTHPROVINCECODE", referencedColumnName = "PROVINCECODE"),
        @JoinColumn(name = "BIRTHCANTONCODE", referencedColumnName = "CANTONCODE"),
        @JoinColumn(name = "BIRTHPARROQUIACODE", referencedColumnName = "PARROQUIACODE")})
    @ManyToOne
    private Tgeneparroquia tgeneparroquia;

    public Tcustpeople() {
    }

    public Tcustpeople(TcustpeoplePK tcustpeoplePK) {
        this.tcustpeoplePK = tcustpeoplePK;
    }

    public Tcustpeople(long personcode, Date dateto) {
        this.tcustpeoplePK = new TcustpeoplePK(personcode, dateto);
    }

    public TcustpeoplePK getTcustpeoplePK() {
        return tcustpeoplePK;
    }

    public void setTcustpeoplePK(TcustpeoplePK tcustpeoplePK) {
        this.tcustpeoplePK = tcustpeoplePK;
    }

    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 getLastname() {
        return lastname;
    }

    public void setLastname(String lastname) {
        this.lastname = lastname;
    }

    public String getSurename() {
        return surename;
    }

    public void setSurename(String surename) {
        this.surename = surename;
    }

    public String getFirstname() {
        return firstname;
    }

    public void setFirstname(String firstname) {
        this.firstname = firstname;
    }

    public String getMiddlename() {
        return middlename;
    }

    public void setMiddlename(String middlename) {
        this.middlename = middlename;
    }

    public String getMaritalname() {
        return maritalname;
    }

    public void setMaritalname(String maritalname) {
        this.maritalname = maritalname;
    }

    public String getGender() {
        return gender;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }

    public Date getBirthdate() {
        return birthdate;
    }

    public void setBirthdate(Date birthdate) {
        this.birthdate = birthdate;
    }

    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 Integer getCodigosib() {
        return codigosib;
    }

    public void setCodigosib(Integer codigosib) {
        this.codigosib = codigosib;
    }

    public BigDecimal getHeight() {
        return height;
    }

    public void setHeight(BigDecimal height) {
        this.height = height;
    }

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

    public Tgenecatalogdetail getTgenecatalogdetail3() {
        return tgenecatalogdetail3;
    }

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

    public Tgenecity getTgenecity() {
        return tgenecity;
    }

    public void setTgenecity(Tgenecity tgenecity) {
        this.tgenecity = tgenecity;
    }

    public Tgenecountry getNacionality() {
        return nacionality;
    }

    public void setNacionality(Tgenecountry nacionality) {
        this.nacionality = nacionality;
    }

    public Tgenefiles getSignaturecode() {
        return signaturecode;
    }

    public void setSignaturecode(Tgenefiles signaturecode) {
        this.signaturecode = signaturecode;
    }

    public Tgenefiles getPhotocode() {
        return photocode;
    }

    public void setPhotocode(Tgenefiles photocode) {
        this.photocode = photocode;
    }

    public Tgeneparroquia getTgeneparroquia() {
        return tgeneparroquia;
    }

    public void setTgeneparroquia(Tgeneparroquia tgeneparroquia) {
        this.tgeneparroquia = tgeneparroquia;
    }

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

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