/*
 * 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.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.TGENEPROVINCEDESC")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Tgeneprovincedesc.findAll", query = "SELECT t FROM Tgeneprovincedesc t"),
    @NamedQuery(name = "Tgeneprovincedesc.findByCountrycode", query = "SELECT t FROM Tgeneprovincedesc t WHERE t.tgeneprovincedescPK.countrycode = :countrycode"),
    @NamedQuery(name = "Tgeneprovincedesc.findByProvincecode", query = "SELECT t FROM Tgeneprovincedesc t WHERE t.tgeneprovincedescPK.provincecode = :provincecode"),
    @NamedQuery(name = "Tgeneprovincedesc.findByLanguage", query = "SELECT t FROM Tgeneprovincedesc t WHERE t.tgeneprovincedescPK.language = :language"),
    @NamedQuery(name = "Tgeneprovincedesc.findByRecordversion", query = "SELECT t FROM Tgeneprovincedesc t WHERE t.recordversion = :recordversion"),
    @NamedQuery(name = "Tgeneprovincedesc.findByDescription", query = "SELECT t FROM Tgeneprovincedesc t WHERE t.description = :description")})
public class Tgeneprovincedesc implements Serializable {

    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected TgeneprovincedescPK tgeneprovincedescPK;
    @Column(name = "RECORDVERSION")
    private BigInteger recordversion;
    @Basic(optional = false)
    @Column(name = "DESCRIPTION")
    private String description;
    @JoinColumn(name = "LANGUAGE", referencedColumnName = "LANGUAGECODE", insertable = false, updatable = false)
    @ManyToOne(optional = false)
    private Tgenelanguage tgenelanguage;
    @JoinColumns({
        @JoinColumn(name = "COUNTRYCODE", referencedColumnName = "COUNTRYCODE", insertable = false, updatable = false),
        @JoinColumn(name = "PROVINCECODE", referencedColumnName = "PROVINCECODE", insertable = false, updatable = false)})
    @ManyToOne(optional = false)
    private Tgeneprovince tgeneprovince;

    public Tgeneprovincedesc() {
    }

    public Tgeneprovincedesc(TgeneprovincedescPK tgeneprovincedescPK) {
        this.tgeneprovincedescPK = tgeneprovincedescPK;
    }

    public Tgeneprovincedesc(TgeneprovincedescPK tgeneprovincedescPK, String description) {
        this.tgeneprovincedescPK = tgeneprovincedescPK;
        this.description = description;
    }

    public Tgeneprovincedesc(String countrycode, String provincecode, String language) {
        this.tgeneprovincedescPK = new TgeneprovincedescPK(countrycode, provincecode, language);
    }

    public TgeneprovincedescPK getTgeneprovincedescPK() {
        return tgeneprovincedescPK;
    }

    public void setTgeneprovincedescPK(TgeneprovincedescPK tgeneprovincedescPK) {
        this.tgeneprovincedescPK = tgeneprovincedescPK;
    }

    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 Tgenelanguage getTgenelanguage() {
        return tgenelanguage;
    }

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

    public Tgeneprovince getTgeneprovince() {
        return tgeneprovince;
    }

    public void setTgeneprovince(Tgeneprovince tgeneprovince) {
        this.tgeneprovince = tgeneprovince;
    }

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

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