/*
 * 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.Basic;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
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.TCUSTECONOMICGROUP")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Tcusteconomicgroup.findAll", query = "SELECT t FROM Tcusteconomicgroup t"),
    @NamedQuery(name = "Tcusteconomicgroup.findByGrouppersoncode", query = "SELECT t FROM Tcusteconomicgroup t WHERE t.tcusteconomicgroupPK.grouppersoncode = :grouppersoncode"),
    @NamedQuery(name = "Tcusteconomicgroup.findByPersoncode", query = "SELECT t FROM Tcusteconomicgroup t WHERE t.tcusteconomicgroupPK.personcode = :personcode"),
    @NamedQuery(name = "Tcusteconomicgroup.findByCompanycode", query = "SELECT t FROM Tcusteconomicgroup t WHERE t.tcusteconomicgroupPK.companycode = :companycode"),
    @NamedQuery(name = "Tcusteconomicgroup.findByLegallinkcatalog", query = "SELECT t FROM Tcusteconomicgroup t WHERE t.legallinkcatalog = :legallinkcatalog"),
    @NamedQuery(name = "Tcusteconomicgroup.findByLegallinkcatalogcode", query = "SELECT t FROM Tcusteconomicgroup t WHERE t.legallinkcatalogcode = :legallinkcatalogcode"),
    @NamedQuery(name = "Tcusteconomicgroup.findByRecordversion", query = "SELECT t FROM Tcusteconomicgroup t WHERE t.recordversion = :recordversion"),
    @NamedQuery(name = "Tcusteconomicgroup.findByIngressdate", query = "SELECT t FROM Tcusteconomicgroup t WHERE t.ingressdate = :ingressdate"),
    @NamedQuery(name = "Tcusteconomicgroup.findByExitdate", query = "SELECT t FROM Tcusteconomicgroup t WHERE t.exitdate = :exitdate"),
    @NamedQuery(name = "Tcusteconomicgroup.findByIngressuser", query = "SELECT t FROM Tcusteconomicgroup t WHERE t.ingressuser = :ingressuser"),
    @NamedQuery(name = "Tcusteconomicgroup.findByModifyuser", query = "SELECT t FROM Tcusteconomicgroup t WHERE t.modifyuser = :modifyuser")})
public class Tcusteconomicgroup implements Serializable {

    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected TcusteconomicgroupPK tcusteconomicgroupPK;
    @Column(name = "LEGALLINKCATALOG")
    private String legallinkcatalog;
    @Column(name = "LEGALLINKCATALOGCODE")
    private String legallinkcatalogcode;
    @Basic(optional = false)
    @Column(name = "RECORDVERSION")
    private BigInteger recordversion;
    @Column(name = "INGRESSDATE")
    @Temporal(TemporalType.TIMESTAMP)
    private Date ingressdate;
    @Column(name = "EXITDATE")
    @Temporal(TemporalType.TIMESTAMP)
    private Date exitdate;
    @Column(name = "INGRESSUSER")
    private String ingressuser;
    @Column(name = "MODIFYUSER")
    private String modifyuser;
    @JoinColumn(name = "GROUPPERSONCODE", referencedColumnName = "PERSONCODE", insertable = false, updatable = false)
    @ManyToOne(optional = false)
    private Tcustperson tcustperson;
    @JoinColumn(name = "PERSONCODE", referencedColumnName = "PERSONCODE", insertable = false, updatable = false)
    @ManyToOne(optional = false)
    private Tcustperson tcustperson1;

    public Tcusteconomicgroup() {
    }

    public Tcusteconomicgroup(TcusteconomicgroupPK tcusteconomicgroupPK) {
        this.tcusteconomicgroupPK = tcusteconomicgroupPK;
    }

    public Tcusteconomicgroup(TcusteconomicgroupPK tcusteconomicgroupPK, BigInteger recordversion) {
        this.tcusteconomicgroupPK = tcusteconomicgroupPK;
        this.recordversion = recordversion;
    }

    public Tcusteconomicgroup(long grouppersoncode, long personcode, long companycode) {
        this.tcusteconomicgroupPK = new TcusteconomicgroupPK(grouppersoncode, personcode, companycode);
    }

    public TcusteconomicgroupPK getTcusteconomicgroupPK() {
        return tcusteconomicgroupPK;
    }

    public void setTcusteconomicgroupPK(TcusteconomicgroupPK tcusteconomicgroupPK) {
        this.tcusteconomicgroupPK = tcusteconomicgroupPK;
    }

    public String getLegallinkcatalog() {
        return legallinkcatalog;
    }

    public void setLegallinkcatalog(String legallinkcatalog) {
        this.legallinkcatalog = legallinkcatalog;
    }

    public String getLegallinkcatalogcode() {
        return legallinkcatalogcode;
    }

    public void setLegallinkcatalogcode(String legallinkcatalogcode) {
        this.legallinkcatalogcode = legallinkcatalogcode;
    }

    public BigInteger getRecordversion() {
        return recordversion;
    }

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

    public Date getIngressdate() {
        return ingressdate;
    }

    public void setIngressdate(Date ingressdate) {
        this.ingressdate = ingressdate;
    }

    public Date getExitdate() {
        return exitdate;
    }

    public void setExitdate(Date exitdate) {
        this.exitdate = exitdate;
    }

    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 Tcustperson getTcustperson() {
        return tcustperson;
    }

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

    public Tcustperson getTcustperson1() {
        return tcustperson1;
    }

    public void setTcustperson1(Tcustperson tcustperson1) {
        this.tcustperson1 = tcustperson1;
    }

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

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