/*
 * 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 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.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author developer2
 */
@Entity
@Table(name="COMACO.TCUSTFAMILIARLLINK")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Tcustfamiliarllink.findAll", query = "SELECT t FROM Tcustfamiliarllink t"),
    @NamedQuery(name = "Tcustfamiliarllink.findByPersoncode", query = "SELECT t FROM Tcustfamiliarllink t WHERE t.tcustfamiliarllinkPK.personcode = :personcode"),
    @NamedQuery(name = "Tcustfamiliarllink.findByLinkpersoncode", query = "SELECT t FROM Tcustfamiliarllink t WHERE t.tcustfamiliarllinkPK.linkpersoncode = :linkpersoncode"),
    @NamedQuery(name = "Tcustfamiliarllink.findByRecordversion", query = "SELECT t FROM Tcustfamiliarllink t WHERE t.recordversion = :recordversion"),
    @NamedQuery(name = "Tcustfamiliarllink.findByPropertydivision", query = "SELECT t FROM Tcustfamiliarllink t WHERE t.propertydivision = :propertydivision"),
    @NamedQuery(name = "Tcustfamiliarllink.findByIngressuser", query = "SELECT t FROM Tcustfamiliarllink t WHERE t.ingressuser = :ingressuser"),
    @NamedQuery(name = "Tcustfamiliarllink.findByModifyuser", query = "SELECT t FROM Tcustfamiliarllink t WHERE t.modifyuser = :modifyuser")})
public class Tcustfamiliarllink implements Serializable {

    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected TcustfamiliarllinkPK tcustfamiliarllinkPK;
    @Basic(optional = false)
    @Column(name = "RECORDVERSION")
    private BigInteger recordversion;
    @Column(name = "PROPERTYDIVISION")
    private String propertydivision;
    @Column(name = "INGRESSUSER")
    private String ingressuser;
    @Column(name = "MODIFYUSER")
    private String modifyuser;
    @JoinColumn(name = "PERSONCODE", referencedColumnName = "PERSONCODE", insertable = false, updatable = false)
    @ManyToOne(optional = false)
    private Tcustperson tcustperson;
    @JoinColumn(name = "LINKPERSONCODE", referencedColumnName = "PERSONCODE", insertable = false, updatable = false)
    @ManyToOne(optional = false)
    private Tcustperson tcustperson1;
    @JoinColumns({
        @JoinColumn(name = "FAMILIARLINKCATALOG", referencedColumnName = "CATALOG"),
        @JoinColumn(name = "FAMILIARLINKCATALOGCODE", referencedColumnName = "CATALOGCODE")})
    @ManyToOne
    private Tgenecatalogdetail tgenecatalogdetail;

    public Tcustfamiliarllink() {
    }

    public Tcustfamiliarllink(TcustfamiliarllinkPK tcustfamiliarllinkPK) {
        this.tcustfamiliarllinkPK = tcustfamiliarllinkPK;
    }

    public Tcustfamiliarllink(TcustfamiliarllinkPK tcustfamiliarllinkPK, BigInteger recordversion) {
        this.tcustfamiliarllinkPK = tcustfamiliarllinkPK;
        this.recordversion = recordversion;
    }

    public Tcustfamiliarllink(long personcode, long linkpersoncode) {
        this.tcustfamiliarllinkPK = new TcustfamiliarllinkPK(personcode, linkpersoncode);
    }

    public TcustfamiliarllinkPK getTcustfamiliarllinkPK() {
        return tcustfamiliarllinkPK;
    }

    public void setTcustfamiliarllinkPK(TcustfamiliarllinkPK tcustfamiliarllinkPK) {
        this.tcustfamiliarllinkPK = tcustfamiliarllinkPK;
    }

    public BigInteger getRecordversion() {
        return recordversion;
    }

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

    public String getPropertydivision() {
        return propertydivision;
    }

    public void setPropertydivision(String propertydivision) {
        this.propertydivision = propertydivision;
    }

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

    public Tgenecatalogdetail getTgenecatalogdetail() {
        return tgenecatalogdetail;
    }

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

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

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