/*
 * 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.TGENESUBPRODUCTDESC")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Tgenesubproductdesc.findAll", query = "SELECT t FROM Tgenesubproductdesc t"),
    @NamedQuery(name = "Tgenesubproductdesc.findByModulecode", query = "SELECT t FROM Tgenesubproductdesc t WHERE t.tgenesubproductdescPK.modulecode = :modulecode"),
    @NamedQuery(name = "Tgenesubproductdesc.findByProductcode", query = "SELECT t FROM Tgenesubproductdesc t WHERE t.tgenesubproductdescPK.productcode = :productcode"),
    @NamedQuery(name = "Tgenesubproductdesc.findBySubproductcode", query = "SELECT t FROM Tgenesubproductdesc t WHERE t.tgenesubproductdescPK.subproductcode = :subproductcode"),
    @NamedQuery(name = "Tgenesubproductdesc.findByLanguagecode", query = "SELECT t FROM Tgenesubproductdesc t WHERE t.tgenesubproductdescPK.languagecode = :languagecode"),
    @NamedQuery(name = "Tgenesubproductdesc.findByRecordversion", query = "SELECT t FROM Tgenesubproductdesc t WHERE t.recordversion = :recordversion"),
    @NamedQuery(name = "Tgenesubproductdesc.findByDescription", query = "SELECT t FROM Tgenesubproductdesc t WHERE t.description = :description")})
public class Tgenesubproductdesc implements Serializable {

    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected TgenesubproductdescPK tgenesubproductdescPK;
    @Column(name = "RECORDVERSION")
    private BigInteger recordversion;
    @Column(name = "DESCRIPTION")
    private String description;
    @JoinColumn(name = "LANGUAGECODE", referencedColumnName = "LANGUAGECODE", insertable = false, updatable = false)
    @ManyToOne(optional = false)
    private Tgenelanguage tgenelanguage;
    @JoinColumns({
        @JoinColumn(name = "MODULECODE", referencedColumnName = "MODULECODE", insertable = false, updatable = false),
        @JoinColumn(name = "PRODUCTCODE", referencedColumnName = "PRODUCTCODE", insertable = false, updatable = false),
        @JoinColumn(name = "SUBPRODUCTCODE", referencedColumnName = "SUBPRODUCTCODE", insertable = false, updatable = false)})
    @ManyToOne(optional = false)
    private Tgenesubproduct tgenesubproduct;

    public Tgenesubproductdesc() {
    }

    public Tgenesubproductdesc(TgenesubproductdescPK tgenesubproductdescPK) {
        this.tgenesubproductdescPK = tgenesubproductdescPK;
    }

    public Tgenesubproductdesc(String modulecode, String productcode, String subproductcode, String languagecode) {
        this.tgenesubproductdescPK = new TgenesubproductdescPK(modulecode, productcode, subproductcode, languagecode);
    }

    public TgenesubproductdescPK getTgenesubproductdescPK() {
        return tgenesubproductdescPK;
    }

    public void setTgenesubproductdescPK(TgenesubproductdescPK tgenesubproductdescPK) {
        this.tgenesubproductdescPK = tgenesubproductdescPK;
    }

    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 Tgenesubproduct getTgenesubproduct() {
        return tgenesubproduct;
    }

    public void setTgenesubproduct(Tgenesubproduct tgenesubproduct) {
        this.tgenesubproduct = tgenesubproduct;
    }

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

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