/*
 * 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.Lob;
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.TCUSTCOMPANY")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Tcustcompany.findAll", query = "SELECT t FROM Tcustcompany t"),
    @NamedQuery(name = "Tcustcompany.findByPersoncode", query = "SELECT t FROM Tcustcompany t WHERE t.tcustcompanyPK.personcode = :personcode"),
    @NamedQuery(name = "Tcustcompany.findByDateto", query = "SELECT t FROM Tcustcompany t WHERE t.tcustcompanyPK.dateto = :dateto"),
    @NamedQuery(name = "Tcustcompany.findByDatefrom", query = "SELECT t FROM Tcustcompany t WHERE t.datefrom = :datefrom"),
    @NamedQuery(name = "Tcustcompany.findByRecordversion", query = "SELECT t FROM Tcustcompany t WHERE t.recordversion = :recordversion"),
    @NamedQuery(name = "Tcustcompany.findByCommercialregister", query = "SELECT t FROM Tcustcompany t WHERE t.commercialregister = :commercialregister"),
    @NamedQuery(name = "Tcustcompany.findByEmployercode", query = "SELECT t FROM Tcustcompany t WHERE t.employercode = :employercode"),
    @NamedQuery(name = "Tcustcompany.findByConstitutiondate", query = "SELECT t FROM Tcustcompany t WHERE t.constitutiondate = :constitutiondate"),
    @NamedQuery(name = "Tcustcompany.findByExpirationdate", query = "SELECT t FROM Tcustcompany t WHERE t.expirationdate = :expirationdate"),
    @NamedQuery(name = "Tcustcompany.findByEmployeenumber", query = "SELECT t FROM Tcustcompany t WHERE t.employeenumber = :employeenumber"),
    @NamedQuery(name = "Tcustcompany.findByNominalcapital", query = "SELECT t FROM Tcustcompany t WHERE t.nominalcapital = :nominalcapital"),
    @NamedQuery(name = "Tcustcompany.findByOriginalcapital", query = "SELECT t FROM Tcustcompany t WHERE t.originalcapital = :originalcapital"),
    @NamedQuery(name = "Tcustcompany.findByContributedcapital", query = "SELECT t FROM Tcustcompany t WHERE t.contributedcapital = :contributedcapital"),
    @NamedQuery(name = "Tcustcompany.findByCorporatepurpose", query = "SELECT t FROM Tcustcompany t WHERE t.corporatepurpose = :corporatepurpose"),
    @NamedQuery(name = "Tcustcompany.findByIngressuser", query = "SELECT t FROM Tcustcompany t WHERE t.ingressuser = :ingressuser"),
    @NamedQuery(name = "Tcustcompany.findByModifyuser", query = "SELECT t FROM Tcustcompany t WHERE t.modifyuser = :modifyuser"),
    @NamedQuery(name = "Tcustcompany.findByMembersnumber", query = "SELECT t FROM Tcustcompany t WHERE t.membersnumber = :membersnumber")})
public class Tcustcompany implements Serializable {

    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected TcustcompanyPK tcustcompanyPK;
    @Column(name = "DATEFROM")
    @Temporal(TemporalType.TIMESTAMP)
    private Date datefrom;
    @Column(name = "RECORDVERSION")
    private BigInteger recordversion;
    @Column(name = "COMMERCIALREGISTER")
    private String commercialregister;
    @Column(name = "EMPLOYERCODE")
    private String employercode;
    @Column(name = "CONSTITUTIONDATE")
    @Temporal(TemporalType.TIMESTAMP)
    private Date constitutiondate;
    @Column(name = "EXPIRATIONDATE")
    @Temporal(TemporalType.TIMESTAMP)
    private Date expirationdate;
    @Column(name = "EMPLOYEENUMBER")
    private Integer employeenumber;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Column(name = "NOMINALCAPITAL")
    private BigDecimal nominalcapital;
    @Column(name = "ORIGINALCAPITAL")
    private BigDecimal originalcapital;
    @Column(name = "CONTRIBUTEDCAPITAL")
    private BigDecimal contributedcapital;
    @Column(name = "CORPORATEPURPOSE")
    private String corporatepurpose;
    @Column(name = "INGRESSUSER")
    private String ingressuser;
    @Column(name = "MODIFYUSER")
    private String modifyuser;
    @Column(name = "MEMBERSNUMBER")
    private Integer membersnumber;
    @Lob
    @Column(name = "PICTURE")
    private Serializable picture;
    @JoinColumn(name = "PERSONCODE", referencedColumnName = "PERSONCODE", insertable = false, updatable = false)
    @ManyToOne(optional = false)
    private Tcustperson tcustperson;
    @JoinColumns({
        @JoinColumn(name = "INSTITUTIONTYPECATALOG", referencedColumnName = "CATALOG"),
        @JoinColumn(name = "INSTITUTIONTYPECATALOGCODE", referencedColumnName = "CATALOGCODE")})
    @ManyToOne
    private Tgenecatalogdetail tgenecatalogdetail;
    @JoinColumns({
        @JoinColumn(name = "BUSINESSTYPECATALOG", referencedColumnName = "CATALOG"),
        @JoinColumn(name = "BUSINESSTYPECATALOGCODE", referencedColumnName = "CATALOGCODE")})
    @ManyToOne
    private Tgenecatalogdetail tgenecatalogdetail1;
    @JoinColumns({
        @JoinColumn(name = "OPERATIVESTATUSCATALOG", referencedColumnName = "CATALOG"),
        @JoinColumn(name = "OPERATIVESTATUSCATALOGCODE", referencedColumnName = "CATALOGCODE")})
    @ManyToOne
    private Tgenecatalogdetail tgenecatalogdetail2;
    @JoinColumns({
        @JoinColumn(name = "BUSINESSCLASSCATALOG", referencedColumnName = "CATALOG"),
        @JoinColumn(name = "BUSINESSCLASSCATALOGCODE", referencedColumnName = "CATALOGCODE")})
    @ManyToOne
    private Tgenecatalogdetail tgenecatalogdetail3;
    @JoinColumn(name = "LOGO", referencedColumnName = "CODE")
    @ManyToOne
    private Tgenefiles logo;

    public Tcustcompany() {
    }

    public Tcustcompany(TcustcompanyPK tcustcompanyPK) {
        this.tcustcompanyPK = tcustcompanyPK;
    }

    public Tcustcompany(long personcode, Date dateto) {
        this.tcustcompanyPK = new TcustcompanyPK(personcode, dateto);
    }

    public TcustcompanyPK getTcustcompanyPK() {
        return tcustcompanyPK;
    }

    public void setTcustcompanyPK(TcustcompanyPK tcustcompanyPK) {
        this.tcustcompanyPK = tcustcompanyPK;
    }

    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 getCommercialregister() {
        return commercialregister;
    }

    public void setCommercialregister(String commercialregister) {
        this.commercialregister = commercialregister;
    }

    public String getEmployercode() {
        return employercode;
    }

    public void setEmployercode(String employercode) {
        this.employercode = employercode;
    }

    public Date getConstitutiondate() {
        return constitutiondate;
    }

    public void setConstitutiondate(Date constitutiondate) {
        this.constitutiondate = constitutiondate;
    }

    public Date getExpirationdate() {
        return expirationdate;
    }

    public void setExpirationdate(Date expirationdate) {
        this.expirationdate = expirationdate;
    }

    public Integer getEmployeenumber() {
        return employeenumber;
    }

    public void setEmployeenumber(Integer employeenumber) {
        this.employeenumber = employeenumber;
    }

    public BigDecimal getNominalcapital() {
        return nominalcapital;
    }

    public void setNominalcapital(BigDecimal nominalcapital) {
        this.nominalcapital = nominalcapital;
    }

    public BigDecimal getOriginalcapital() {
        return originalcapital;
    }

    public void setOriginalcapital(BigDecimal originalcapital) {
        this.originalcapital = originalcapital;
    }

    public BigDecimal getContributedcapital() {
        return contributedcapital;
    }

    public void setContributedcapital(BigDecimal contributedcapital) {
        this.contributedcapital = contributedcapital;
    }

    public String getCorporatepurpose() {
        return corporatepurpose;
    }

    public void setCorporatepurpose(String corporatepurpose) {
        this.corporatepurpose = corporatepurpose;
    }

    public String getIngressuser() {
        return ingressuser;
    }

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

    public String getModifyuser() {
        return modifyuser;
    }

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

    public Integer getMembersnumber() {
        return membersnumber;
    }

    public void setMembersnumber(Integer membersnumber) {
        this.membersnumber = membersnumber;
    }

    public Serializable getPicture() {
        return picture;
    }

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

    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 Tgenefiles getLogo() {
        return logo;
    }

    public void setLogo(Tgenefiles logo) {
        this.logo = logo;
    }

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

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