/*
 * 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.Basic;
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.TGENECOUNTRYDESC")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Tgenecountrydesc.findAll", query = "SELECT t FROM Tgenecountrydesc t"),
    @NamedQuery(name = "Tgenecountrydesc.findByCountrycode", query = "SELECT t FROM Tgenecountrydesc t WHERE t.tgenecountrydescPK.countrycode = :countrycode"),
    @NamedQuery(name = "Tgenecountrydesc.findByLanguage", query = "SELECT t FROM Tgenecountrydesc t WHERE t.tgenecountrydescPK.language = :language"),
    @NamedQuery(name = "Tgenecountrydesc.findByRecordversion", query = "SELECT t FROM Tgenecountrydesc t WHERE t.recordversion = :recordversion"),
    @NamedQuery(name = "Tgenecountrydesc.findByDescription", query = "SELECT t FROM Tgenecountrydesc t WHERE t.description = :description"),
    @NamedQuery(name = "Tgenecountrydesc.findByCitizenship", query = "SELECT t FROM Tgenecountrydesc t WHERE t.citizenship = :citizenship")})
public class Tgenecountrydesc implements Serializable {

    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected TgenecountrydescPK tgenecountrydescPK;
    @Column(name = "RECORDVERSION")
    private BigInteger recordversion;
    @Basic(optional = false)
    @Column(name = "DESCRIPTION")
    private String description;
    @Column(name = "CITIZENSHIP")
    private String citizenship;
    @JoinColumn(name = "COUNTRYCODE", referencedColumnName = "COUNTRYCODE", insertable = false, updatable = false)
    @ManyToOne(optional = false)
    private Tgenecountry tgenecountry;
    @JoinColumn(name = "LANGUAGE", referencedColumnName = "LANGUAGECODE", insertable = false, updatable = false)
    @ManyToOne(optional = false)
    private Tgenelanguage tgenelanguage;

    public Tgenecountrydesc() {
    }

    public Tgenecountrydesc(TgenecountrydescPK tgenecountrydescPK) {
        this.tgenecountrydescPK = tgenecountrydescPK;
    }

    public Tgenecountrydesc(TgenecountrydescPK tgenecountrydescPK, String description) {
        this.tgenecountrydescPK = tgenecountrydescPK;
        this.description = description;
    }

    public Tgenecountrydesc(String countrycode, String language) {
        this.tgenecountrydescPK = new TgenecountrydescPK(countrycode, language);
    }

    public TgenecountrydescPK getTgenecountrydescPK() {
        return tgenecountrydescPK;
    }

    public void setTgenecountrydescPK(TgenecountrydescPK tgenecountrydescPK) {
        this.tgenecountrydescPK = tgenecountrydescPK;
    }

    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 String getCitizenship() {
        return citizenship;
    }

    public void setCitizenship(String citizenship) {
        this.citizenship = citizenship;
    }

    public Tgenecountry getTgenecountry() {
        return tgenecountry;
    }

    public void setTgenecountry(Tgenecountry tgenecountry) {
        this.tgenecountry = tgenecountry;
    }

    public Tgenelanguage getTgenelanguage() {
        return tgenelanguage;
    }

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

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

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