/*
 * 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.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.TGENEBALANCEGROUP")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Tgenebalancegroup.findAll", query = "SELECT t FROM Tgenebalancegroup t"),
    @NamedQuery(name = "Tgenebalancegroup.findByBalancegroup", query = "SELECT t FROM Tgenebalancegroup t WHERE t.balancegroup = :balancegroup"),
    @NamedQuery(name = "Tgenebalancegroup.findByRecordversion", query = "SELECT t FROM Tgenebalancegroup t WHERE t.recordversion = :recordversion"),
    @NamedQuery(name = "Tgenebalancegroup.findByIsadd", query = "SELECT t FROM Tgenebalancegroup t WHERE t.isadd = :isadd"),
    @NamedQuery(name = "Tgenebalancegroup.findByDescription", query = "SELECT t FROM Tgenebalancegroup t WHERE t.description = :description"),
    @NamedQuery(name = "Tgenebalancegroup.findByOpposite", query = "SELECT t FROM Tgenebalancegroup t WHERE t.opposite = :opposite")})
public class Tgenebalancegroup implements Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "BALANCEGROUP")
    private String balancegroup;
    @Column(name = "RECORDVERSION")
    private BigInteger recordversion;
    @Basic(optional = false)
    @Column(name = "ISADD")
    private String isadd;
    @Basic(optional = false)
    @Column(name = "DESCRIPTION")
    private String description;
    @Column(name = "OPPOSITE")
    private String opposite;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "tgenebalancegroup")
    private Collection<Tgenebalancetype> tgenebalancetypeCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "tgenebalancegroup")
    private Collection<Tgenebalancegroupdesc> tgenebalancegroupdescCollection;

    public Tgenebalancegroup() {
    }

    public Tgenebalancegroup(String balancegroup) {
        this.balancegroup = balancegroup;
    }

    public Tgenebalancegroup(String balancegroup, String isadd, String description) {
        this.balancegroup = balancegroup;
        this.isadd = isadd;
        this.description = description;
    }

    public String getBalancegroup() {
        return balancegroup;
    }

    public void setBalancegroup(String balancegroup) {
        this.balancegroup = balancegroup;
    }

    public BigInteger getRecordversion() {
        return recordversion;
    }

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

    public String getIsadd() {
        return isadd;
    }

    public void setIsadd(String isadd) {
        this.isadd = isadd;
    }

    public String getDescription() {
        return description;
    }

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

    public String getOpposite() {
        return opposite;
    }

    public void setOpposite(String opposite) {
        this.opposite = opposite;
    }

    @XmlTransient
    public Collection<Tgenebalancetype> getTgenebalancetypeCollection() {
        return tgenebalancetypeCollection;
    }

    public void setTgenebalancetypeCollection(Collection<Tgenebalancetype> tgenebalancetypeCollection) {
        this.tgenebalancetypeCollection = tgenebalancetypeCollection;
    }

    @XmlTransient
    public Collection<Tgenebalancegroupdesc> getTgenebalancegroupdescCollection() {
        return tgenebalancegroupdescCollection;
    }

    public void setTgenebalancegroupdescCollection(Collection<Tgenebalancegroupdesc> tgenebalancegroupdescCollection) {
        this.tgenebalancegroupdescCollection = tgenebalancegroupdescCollection;
    }

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

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