/*
 * 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.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.TGENEFREQUENCYDESC")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Tgenefrequencydesc.findAll", query = "SELECT t FROM Tgenefrequencydesc t"),
    @NamedQuery(name = "Tgenefrequencydesc.findByFrequencycode", query = "SELECT t FROM Tgenefrequencydesc t WHERE t.tgenefrequencydescPK.frequencycode = :frequencycode"),
    @NamedQuery(name = "Tgenefrequencydesc.findByLanguage", query = "SELECT t FROM Tgenefrequencydesc t WHERE t.tgenefrequencydescPK.language = :language"),
    @NamedQuery(name = "Tgenefrequencydesc.findByRecordversion", query = "SELECT t FROM Tgenefrequencydesc t WHERE t.recordversion = :recordversion"),
    @NamedQuery(name = "Tgenefrequencydesc.findByDescription", query = "SELECT t FROM Tgenefrequencydesc t WHERE t.description = :description")})
public class Tgenefrequencydesc implements Serializable {

    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected TgenefrequencydescPK tgenefrequencydescPK;
    @Column(name = "RECORDVERSION")
    private BigInteger recordversion;
    @Column(name = "DESCRIPTION")
    private String description;
    @JoinColumn(name = "FREQUENCYCODE", referencedColumnName = "FRECQENCYCODE", insertable = false, updatable = false)
    @ManyToOne(optional = false)
    private Tgenefrequency tgenefrequency;
    @JoinColumn(name = "LANGUAGE", referencedColumnName = "LANGUAGECODE", insertable = false, updatable = false)
    @ManyToOne(optional = false)
    private Tgenelanguage tgenelanguage;

    public Tgenefrequencydesc() {
    }

    public Tgenefrequencydesc(TgenefrequencydescPK tgenefrequencydescPK) {
        this.tgenefrequencydescPK = tgenefrequencydescPK;
    }

    public Tgenefrequencydesc(short frequencycode, String language) {
        this.tgenefrequencydescPK = new TgenefrequencydescPK(frequencycode, language);
    }

    public TgenefrequencydescPK getTgenefrequencydescPK() {
        return tgenefrequencydescPK;
    }

    public void setTgenefrequencydescPK(TgenefrequencydescPK tgenefrequencydescPK) {
        this.tgenefrequencydescPK = tgenefrequencydescPK;
    }

    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 Tgenefrequency getTgenefrequency() {
        return tgenefrequency;
    }

    public void setTgenefrequency(Tgenefrequency tgenefrequency) {
        this.tgenefrequency = tgenefrequency;
    }

    public Tgenelanguage getTgenelanguage() {
        return tgenelanguage;
    }

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

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

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