/*
 * 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.TGENEMENUDESC")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Tgenemenudesc.findAll", query = "SELECT t FROM Tgenemenudesc t"),
    @NamedQuery(name = "Tgenemenudesc.findByMenucode", query = "SELECT t FROM Tgenemenudesc t WHERE t.tgenemenudescPK.menucode = :menucode"),
    @NamedQuery(name = "Tgenemenudesc.findByLanguagecode", query = "SELECT t FROM Tgenemenudesc t WHERE t.tgenemenudescPK.languagecode = :languagecode"),
    @NamedQuery(name = "Tgenemenudesc.findByRecordversion", query = "SELECT t FROM Tgenemenudesc t WHERE t.recordversion = :recordversion"),
    @NamedQuery(name = "Tgenemenudesc.findByName", query = "SELECT t FROM Tgenemenudesc t WHERE t.name = :name"),
    @NamedQuery(name = "Tgenemenudesc.findByDescription", query = "SELECT t FROM Tgenemenudesc t WHERE t.description = :description")})
public class Tgenemenudesc implements Serializable {

    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected TgenemenudescPK tgenemenudescPK;
    @Column(name = "RECORDVERSION")
    private BigInteger recordversion;
    @Column(name = "NAME")
    private String name;
    @Column(name = "DESCRIPTION")
    private String description;
    @JoinColumn(name = "LANGUAGECODE", referencedColumnName = "LANGUAGECODE", insertable = false, updatable = false)
    @ManyToOne(optional = false)
    private Tgenelanguage tgenelanguage;
    @JoinColumn(name = "MENUCODE", referencedColumnName = "MENUCODE", insertable = false, updatable = false)
    @ManyToOne(optional = false)
    private Tgenemenu tgenemenu;

    public Tgenemenudesc() {
    }

    public Tgenemenudesc(TgenemenudescPK tgenemenudescPK) {
        this.tgenemenudescPK = tgenemenudescPK;
    }

    public Tgenemenudesc(int menucode, String languagecode) {
        this.tgenemenudescPK = new TgenemenudescPK(menucode, languagecode);
    }

    public TgenemenudescPK getTgenemenudescPK() {
        return tgenemenudescPK;
    }

    public void setTgenemenudescPK(TgenemenudescPK tgenemenudescPK) {
        this.tgenemenudescPK = tgenemenudescPK;
    }

    public BigInteger getRecordversion() {
        return recordversion;
    }

    public void setRecordversion(BigInteger recordversion) {
        this.recordversion = recordversion;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    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 Tgenemenu getTgenemenu() {
        return tgenemenu;
    }

    public void setTgenemenu(Tgenemenu tgenemenu) {
        this.tgenemenu = tgenemenu;
    }

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

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