/*
 * 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 javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author developer2
 */
@Entity
@Table(name="COMACO.TGENECOMPANY")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Tgenecompany.findAll", query = "SELECT t FROM Tgenecompany t"),
    @NamedQuery(name = "Tgenecompany.findByCompanycode", query = "SELECT t FROM Tgenecompany t WHERE t.companycode = :companycode"),
    @NamedQuery(name = "Tgenecompany.findByRecordversion", query = "SELECT t FROM Tgenecompany t WHERE t.recordversion = :recordversion"),
    @NamedQuery(name = "Tgenecompany.findByActive", query = "SELECT t FROM Tgenecompany t WHERE t.active = :active"),
    @NamedQuery(name = "Tgenecompany.findByAccoserver", query = "SELECT t FROM Tgenecompany t WHERE t.accoserver = :accoserver")})
public class Tgenecompany implements Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "COMPANYCODE")
    private Long companycode;
    @Column(name = "RECORDVERSION")
    private BigInteger recordversion;
    @Column(name = "ACTIVE")
    private String active;
    @Column(name = "ACCOSERVER")
    private String accoserver;
    @JoinTable(name = "TCUSTAPPRAISER", joinColumns = {
        @JoinColumn(name = "COMPANYCODE", referencedColumnName = "COMPANYCODE")}, inverseJoinColumns = {
        @JoinColumn(name = "PERSONCODE", referencedColumnName = "PERSONCODE")})
    @ManyToMany
    private Collection<Tcustperson> tcustpersonCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "tgenecompany")
    private Collection<Tsafepassword> tsafepasswordCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "tgenecompany")
    private Collection<Tgenechargesgroup> tgenechargesgroupCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "tgenecompany")
    private Collection<Tbpmrules> tbpmrulesCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "tgenecompany")
    private Collection<Tgenesubproductcharges> tgenesubproductchargesCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "tgenecompany")
    private Collection<Tgenecharges> tgenechargesCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "tgenecompany")
    private Collection<Tgenetechnicalpatrimony> tgenetechnicalpatrimonyCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "tgenecompany")
    private Collection<Tgenetransactionreportlink> tgenetransactionreportlinkCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "tgenecompany")
    private Collection<Tgeneratesgroup> tgeneratesgroupCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "tgenecompany")
    private Collection<Tgenechargescheckbook> tgenechargescheckbookCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "tgenecompany")
    private Collection<Tbpmflows> tbpmflowsCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "tgenecompany")
    private Collection<Tcustlegallink> tcustlegallinkCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "tgenecompany")
    private Collection<Tbpmgroups> tbpmgroupsCollection;
    @JoinColumn(name = "PERSONCODE", referencedColumnName = "PERSONCODE")
    @ManyToOne
    private Tcustperson personcode;
    @JoinColumn(name = "LEGALCURRENCY", referencedColumnName = "CURRENCYCODE")
    @ManyToOne
    private Tgenecurrency legalcurrency;
    @OneToMany(mappedBy = "companycode")
    private Collection<Tcustpersonbalance> tcustpersonbalanceCollection;
    @OneToMany(mappedBy = "companycode")
    private Collection<Tsafeuser> tsafeuserCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "tgenecompany")
    private Collection<Tgenesegmentrate> tgenesegmentrateCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "tgenecompany")
    private Collection<Tgenearea> tgeneareaCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "tgenecompany")
    private Collection<Tgenebranch> tgenebranchCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "tgenecompany")
    private Collection<Tgeneparameters> tgeneparametersCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "tgenecompany")
    private Collection<Tgenesubproductrate> tgenesubproductrateCollection;

    public Tgenecompany() {
    }

    public Tgenecompany(Long companycode) {
        this.companycode = companycode;
    }

    public Long getCompanycode() {
        return companycode;
    }

    public void setCompanycode(Long companycode) {
        this.companycode = companycode;
    }

    public BigInteger getRecordversion() {
        return recordversion;
    }

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

    public String getActive() {
        return active;
    }

    public void setActive(String active) {
        this.active = active;
    }

    public String getAccoserver() {
        return accoserver;
    }

    public void setAccoserver(String accoserver) {
        this.accoserver = accoserver;
    }

    @XmlTransient
    public Collection<Tcustperson> getTcustpersonCollection() {
        return tcustpersonCollection;
    }

    public void setTcustpersonCollection(Collection<Tcustperson> tcustpersonCollection) {
        this.tcustpersonCollection = tcustpersonCollection;
    }

    @XmlTransient
    public Collection<Tsafepassword> getTsafepasswordCollection() {
        return tsafepasswordCollection;
    }

    public void setTsafepasswordCollection(Collection<Tsafepassword> tsafepasswordCollection) {
        this.tsafepasswordCollection = tsafepasswordCollection;
    }

    @XmlTransient
    public Collection<Tgenechargesgroup> getTgenechargesgroupCollection() {
        return tgenechargesgroupCollection;
    }

    public void setTgenechargesgroupCollection(Collection<Tgenechargesgroup> tgenechargesgroupCollection) {
        this.tgenechargesgroupCollection = tgenechargesgroupCollection;
    }

    @XmlTransient
    public Collection<Tbpmrules> getTbpmrulesCollection() {
        return tbpmrulesCollection;
    }

    public void setTbpmrulesCollection(Collection<Tbpmrules> tbpmrulesCollection) {
        this.tbpmrulesCollection = tbpmrulesCollection;
    }

    @XmlTransient
    public Collection<Tgenesubproductcharges> getTgenesubproductchargesCollection() {
        return tgenesubproductchargesCollection;
    }

    public void setTgenesubproductchargesCollection(Collection<Tgenesubproductcharges> tgenesubproductchargesCollection) {
        this.tgenesubproductchargesCollection = tgenesubproductchargesCollection;
    }

    @XmlTransient
    public Collection<Tgenecharges> getTgenechargesCollection() {
        return tgenechargesCollection;
    }

    public void setTgenechargesCollection(Collection<Tgenecharges> tgenechargesCollection) {
        this.tgenechargesCollection = tgenechargesCollection;
    }

    @XmlTransient
    public Collection<Tgenetechnicalpatrimony> getTgenetechnicalpatrimonyCollection() {
        return tgenetechnicalpatrimonyCollection;
    }

    public void setTgenetechnicalpatrimonyCollection(Collection<Tgenetechnicalpatrimony> tgenetechnicalpatrimonyCollection) {
        this.tgenetechnicalpatrimonyCollection = tgenetechnicalpatrimonyCollection;
    }

    @XmlTransient
    public Collection<Tgenetransactionreportlink> getTgenetransactionreportlinkCollection() {
        return tgenetransactionreportlinkCollection;
    }

    public void setTgenetransactionreportlinkCollection(Collection<Tgenetransactionreportlink> tgenetransactionreportlinkCollection) {
        this.tgenetransactionreportlinkCollection = tgenetransactionreportlinkCollection;
    }

    @XmlTransient
    public Collection<Tgeneratesgroup> getTgeneratesgroupCollection() {
        return tgeneratesgroupCollection;
    }

    public void setTgeneratesgroupCollection(Collection<Tgeneratesgroup> tgeneratesgroupCollection) {
        this.tgeneratesgroupCollection = tgeneratesgroupCollection;
    }

    @XmlTransient
    public Collection<Tgenechargescheckbook> getTgenechargescheckbookCollection() {
        return tgenechargescheckbookCollection;
    }

    public void setTgenechargescheckbookCollection(Collection<Tgenechargescheckbook> tgenechargescheckbookCollection) {
        this.tgenechargescheckbookCollection = tgenechargescheckbookCollection;
    }

    @XmlTransient
    public Collection<Tbpmflows> getTbpmflowsCollection() {
        return tbpmflowsCollection;
    }

    public void setTbpmflowsCollection(Collection<Tbpmflows> tbpmflowsCollection) {
        this.tbpmflowsCollection = tbpmflowsCollection;
    }

    @XmlTransient
    public Collection<Tcustlegallink> getTcustlegallinkCollection() {
        return tcustlegallinkCollection;
    }

    public void setTcustlegallinkCollection(Collection<Tcustlegallink> tcustlegallinkCollection) {
        this.tcustlegallinkCollection = tcustlegallinkCollection;
    }

    @XmlTransient
    public Collection<Tbpmgroups> getTbpmgroupsCollection() {
        return tbpmgroupsCollection;
    }

    public void setTbpmgroupsCollection(Collection<Tbpmgroups> tbpmgroupsCollection) {
        this.tbpmgroupsCollection = tbpmgroupsCollection;
    }

    public Tcustperson getPersoncode() {
        return personcode;
    }

    public void setPersoncode(Tcustperson personcode) {
        this.personcode = personcode;
    }

    public Tgenecurrency getLegalcurrency() {
        return legalcurrency;
    }

    public void setLegalcurrency(Tgenecurrency legalcurrency) {
        this.legalcurrency = legalcurrency;
    }

    @XmlTransient
    public Collection<Tcustpersonbalance> getTcustpersonbalanceCollection() {
        return tcustpersonbalanceCollection;
    }

    public void setTcustpersonbalanceCollection(Collection<Tcustpersonbalance> tcustpersonbalanceCollection) {
        this.tcustpersonbalanceCollection = tcustpersonbalanceCollection;
    }

    @XmlTransient
    public Collection<Tsafeuser> getTsafeuserCollection() {
        return tsafeuserCollection;
    }

    public void setTsafeuserCollection(Collection<Tsafeuser> tsafeuserCollection) {
        this.tsafeuserCollection = tsafeuserCollection;
    }

    @XmlTransient
    public Collection<Tgenesegmentrate> getTgenesegmentrateCollection() {
        return tgenesegmentrateCollection;
    }

    public void setTgenesegmentrateCollection(Collection<Tgenesegmentrate> tgenesegmentrateCollection) {
        this.tgenesegmentrateCollection = tgenesegmentrateCollection;
    }

    @XmlTransient
    public Collection<Tgenearea> getTgeneareaCollection() {
        return tgeneareaCollection;
    }

    public void setTgeneareaCollection(Collection<Tgenearea> tgeneareaCollection) {
        this.tgeneareaCollection = tgeneareaCollection;
    }

    @XmlTransient
    public Collection<Tgenebranch> getTgenebranchCollection() {
        return tgenebranchCollection;
    }

    public void setTgenebranchCollection(Collection<Tgenebranch> tgenebranchCollection) {
        this.tgenebranchCollection = tgenebranchCollection;
    }

    @XmlTransient
    public Collection<Tgeneparameters> getTgeneparametersCollection() {
        return tgeneparametersCollection;
    }

    public void setTgeneparametersCollection(Collection<Tgeneparameters> tgeneparametersCollection) {
        this.tgeneparametersCollection = tgeneparametersCollection;
    }

    @XmlTransient
    public Collection<Tgenesubproductrate> getTgenesubproductrateCollection() {
        return tgenesubproductrateCollection;
    }

    public void setTgenesubproductrateCollection(Collection<Tgenesubproductrate> tgenesubproductrateCollection) {
        this.tgenesubproductrateCollection = tgenesubproductrateCollection;
    }

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

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