/*
 * 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.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.TGENEBALANCETYPEDESC")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Tgenebalancetypedesc.findAll", query = "SELECT t FROM Tgenebalancetypedesc t"),
    @NamedQuery(name = "Tgenebalancetypedesc.findByBalancetype", query = "SELECT t FROM Tgenebalancetypedesc t WHERE t.tgenebalancetypedescPK.balancetype = :balancetype"),
    @NamedQuery(name = "Tgenebalancetypedesc.findByBalancegroup", query = "SELECT t FROM Tgenebalancetypedesc t WHERE t.tgenebalancetypedescPK.balancegroup = :balancegroup"),
    @NamedQuery(name = "Tgenebalancetypedesc.findByLanguagecode", query = "SELECT t FROM Tgenebalancetypedesc t WHERE t.tgenebalancetypedescPK.languagecode = :languagecode"),
    @NamedQuery(name = "Tgenebalancetypedesc.findByRecordversion", query = "SELECT t FROM Tgenebalancetypedesc t WHERE t.recordversion = :recordversion"),
    @NamedQuery(name = "Tgenebalancetypedesc.findByDescription", query = "SELECT t FROM Tgenebalancetypedesc t WHERE t.description = :description")})
public class Tgenebalancetypedesc implements Serializable {

    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected TgenebalancetypedescPK tgenebalancetypedescPK;
    @Column(name = "RECORDVERSION")
    private BigInteger recordversion;
    @Column(name = "DESCRIPTION")
    private String description;
    @JoinColumns({
        @JoinColumn(name = "BALANCETYPE", referencedColumnName = "BALANCETYPE", insertable = false, updatable = false),
        @JoinColumn(name = "BALANCEGROUP", referencedColumnName = "BALANCEGROUP", insertable = false, updatable = false)})
    @ManyToOne(optional = false)
    private Tgenebalancetype tgenebalancetype;
    @JoinColumn(name = "LANGUAGECODE", referencedColumnName = "LANGUAGECODE", insertable = false, updatable = false)
    @ManyToOne(optional = false)
    private Tgenelanguage tgenelanguage;

    public Tgenebalancetypedesc() {
    }

    public Tgenebalancetypedesc(TgenebalancetypedescPK tgenebalancetypedescPK) {
        this.tgenebalancetypedescPK = tgenebalancetypedescPK;
    }

    public Tgenebalancetypedesc(String balancetype, String balancegroup, String languagecode) {
        this.tgenebalancetypedescPK = new TgenebalancetypedescPK(balancetype, balancegroup, languagecode);
    }

    public TgenebalancetypedescPK getTgenebalancetypedescPK() {
        return tgenebalancetypedescPK;
    }

    public void setTgenebalancetypedescPK(TgenebalancetypedescPK tgenebalancetypedescPK) {
        this.tgenebalancetypedescPK = tgenebalancetypedescPK;
    }

    public BigInteger getRecordversion() {
        return recordversion;
    }

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

    public String getDescription() {
        return description;
    }

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

    public Tgenebalancetype getTgenebalancetype() {
        return tgenebalancetype;
    }

    public void setTgenebalancetype(Tgenebalancetype tgenebalancetype) {
        this.tgenebalancetype = tgenebalancetype;
    }

    public Tgenelanguage getTgenelanguage() {
        return tgenelanguage;
    }

    public void setTgenelanguage(Tgenelanguage tgenelanguage) {
        this.tgenelanguage = tgenelanguage;
    }

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

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