/*
 * 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.TGENECATALOGDETAILDESC")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Tgenecatalogdetaildesc.findAll", query = "SELECT t FROM Tgenecatalogdetaildesc t"),
    @NamedQuery(name = "Tgenecatalogdetaildesc.findByCatalog", query = "SELECT t FROM Tgenecatalogdetaildesc t WHERE t.tgenecatalogdetaildescPK.catalog = :catalog"),
    @NamedQuery(name = "Tgenecatalogdetaildesc.findByCatalogcode", query = "SELECT t FROM Tgenecatalogdetaildesc t WHERE t.tgenecatalogdetaildescPK.catalogcode = :catalogcode"),
    @NamedQuery(name = "Tgenecatalogdetaildesc.findByLanguagecode", query = "SELECT t FROM Tgenecatalogdetaildesc t WHERE t.tgenecatalogdetaildescPK.languagecode = :languagecode"),
    @NamedQuery(name = "Tgenecatalogdetaildesc.findByRecordversion", query = "SELECT t FROM Tgenecatalogdetaildesc t WHERE t.recordversion = :recordversion"),
    @NamedQuery(name = "Tgenecatalogdetaildesc.findByDescription", query = "SELECT t FROM Tgenecatalogdetaildesc t WHERE t.description = :description")})
public class Tgenecatalogdetaildesc implements Serializable {

    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected TgenecatalogdetaildescPK tgenecatalogdetaildescPK;
    @Column(name = "RECORDVERSION")
    private BigInteger recordversion;
    @Column(name = "DESCRIPTION")
    private String description;
    @JoinColumns({
        @JoinColumn(name = "CATALOG", referencedColumnName = "CATALOG", insertable = false, updatable = false),
        @JoinColumn(name = "CATALOGCODE", referencedColumnName = "CATALOGCODE", insertable = false, updatable = false)})
    @ManyToOne(optional = false)
    private Tgenecatalogdetail tgenecatalogdetail;
    @JoinColumn(name = "LANGUAGECODE", referencedColumnName = "LANGUAGECODE", insertable = false, updatable = false)
    @ManyToOne(optional = false)
    private Tgenelanguage tgenelanguage;

    public Tgenecatalogdetaildesc() {
    }

    public Tgenecatalogdetaildesc(TgenecatalogdetaildescPK tgenecatalogdetaildescPK) {
        this.tgenecatalogdetaildescPK = tgenecatalogdetaildescPK;
    }

    public Tgenecatalogdetaildesc(String catalog, String catalogcode, String languagecode) {
        this.tgenecatalogdetaildescPK = new TgenecatalogdetaildescPK(catalog, catalogcode, languagecode);
    }

    public TgenecatalogdetaildescPK getTgenecatalogdetaildescPK() {
        return tgenecatalogdetaildescPK;
    }

    public void setTgenecatalogdetaildescPK(TgenecatalogdetaildescPK tgenecatalogdetaildescPK) {
        this.tgenecatalogdetaildescPK = tgenecatalogdetaildescPK;
    }

    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 Tgenecatalogdetail getTgenecatalogdetail() {
        return tgenecatalogdetail;
    }

    public void setTgenecatalogdetail(Tgenecatalogdetail tgenecatalogdetail) {
        this.tgenecatalogdetail = tgenecatalogdetail;
    }

    public Tgenelanguage getTgenelanguage() {
        return tgenelanguage;
    }

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

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

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