/*
 * 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.util.Collection;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
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.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author developer2
 */
@Entity
@Table(name="COMACO.TGENEBALANCETYPE")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Tgenebalancetype.findAll", query = "SELECT t FROM Tgenebalancetype t"),
    @NamedQuery(name = "Tgenebalancetype.findByBalancetype", query = "SELECT t FROM Tgenebalancetype t WHERE t.tgenebalancetypePK.balancetype = :balancetype"),
    @NamedQuery(name = "Tgenebalancetype.findByBalancegroup", query = "SELECT t FROM Tgenebalancetype t WHERE t.tgenebalancetypePK.balancegroup = :balancegroup"),
    @NamedQuery(name = "Tgenebalancetype.findByDescription", query = "SELECT t FROM Tgenebalancetype t WHERE t.description = :description"),
    @NamedQuery(name = "Tgenebalancetype.findByBalancecategory", query = "SELECT t FROM Tgenebalancetype t WHERE t.balancecategory = :balancecategory"),
    @NamedQuery(name = "Tgenebalancetype.findByChargeforinstallment", query = "SELECT t FROM Tgenebalancetype t WHERE t.chargeforinstallment = :chargeforinstallment")})
public class Tgenebalancetype implements Serializable {

    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected TgenebalancetypePK tgenebalancetypePK;
    @Basic(optional = false)
    @Column(name = "DESCRIPTION")
    private String description;
    @Column(name = "BALANCECATEGORY")
    private String balancecategory;
    @Column(name = "CHARGEFORINSTALLMENT")
    private String chargeforinstallment;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "tgenebalancetype")
    private Collection<Tgenechargesgroup> tgenechargesgroupCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "tgenebalancetype")
    private Collection<Tgenesubproductcharges> tgenesubproductchargesCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "tgenebalancetype")
    private Collection<Tgenecharges> tgenechargesCollection;
    @OneToOne(cascade = CascadeType.ALL, mappedBy = "tgenebalancetype")
    private Tgenebalancetypedetail tgenebalancetypedetail;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "tgenebalancetype")
    private Collection<Tgeneratesgroup> tgeneratesgroupCollection;
    @JoinColumn(name = "BALANCEGROUP", referencedColumnName = "BALANCEGROUP", insertable = false, updatable = false)
    @ManyToOne(optional = false)
    private Tgenebalancegroup tgenebalancegroup;
    @JoinColumn(name = "MODULECODE", referencedColumnName = "MODULECODE")
    @ManyToOne
    private Tgenemodule modulecode;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "tgenebalancetype")
    private Collection<Tgenesegmentrate> tgenesegmentrateCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "tgenebalancetype")
    private Collection<Tgenebalancetypedesc> tgenebalancetypedescCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "tgenebalancetype")
    private Collection<Tgenesubproductrate> tgenesubproductrateCollection;

    public Tgenebalancetype() {
    }

    public Tgenebalancetype(TgenebalancetypePK tgenebalancetypePK) {
        this.tgenebalancetypePK = tgenebalancetypePK;
    }

    public Tgenebalancetype(TgenebalancetypePK tgenebalancetypePK, String description) {
        this.tgenebalancetypePK = tgenebalancetypePK;
        this.description = description;
    }

    public Tgenebalancetype(String balancetype, String balancegroup) {
        this.tgenebalancetypePK = new TgenebalancetypePK(balancetype, balancegroup);
    }

    public TgenebalancetypePK getTgenebalancetypePK() {
        return tgenebalancetypePK;
    }

    public void setTgenebalancetypePK(TgenebalancetypePK tgenebalancetypePK) {
        this.tgenebalancetypePK = tgenebalancetypePK;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getBalancecategory() {
        return balancecategory;
    }

    public void setBalancecategory(String balancecategory) {
        this.balancecategory = balancecategory;
    }

    public String getChargeforinstallment() {
        return chargeforinstallment;
    }

    public void setChargeforinstallment(String chargeforinstallment) {
        this.chargeforinstallment = chargeforinstallment;
    }

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

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

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

    public Tgenebalancetypedetail getTgenebalancetypedetail() {
        return tgenebalancetypedetail;
    }

    public void setTgenebalancetypedetail(Tgenebalancetypedetail tgenebalancetypedetail) {
        this.tgenebalancetypedetail = tgenebalancetypedetail;
    }

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

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

    public Tgenebalancegroup getTgenebalancegroup() {
        return tgenebalancegroup;
    }

    public void setTgenebalancegroup(Tgenebalancegroup tgenebalancegroup) {
        this.tgenebalancegroup = tgenebalancegroup;
    }

    public Tgenemodule getModulecode() {
        return modulecode;
    }

    public void setModulecode(Tgenemodule modulecode) {
        this.modulecode = modulecode;
    }

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

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

    @XmlTransient
    public Collection<Tgenebalancetypedesc> getTgenebalancetypedescCollection() {
        return tgenebalancetypedescCollection;
    }

    public void setTgenebalancetypedescCollection(Collection<Tgenebalancetypedesc> tgenebalancetypedescCollection) {
        this.tgenebalancetypedescCollection = tgenebalancetypedescCollection;
    }

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

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

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

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