/*
 * 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.TGENEMENUSUBLEVELDESC")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Tgenemenusubleveldesc.findAll", query = "SELECT t FROM Tgenemenusubleveldesc t"),
    @NamedQuery(name = "Tgenemenusubleveldesc.findByMenucode", query = "SELECT t FROM Tgenemenusubleveldesc t WHERE t.tgenemenusubleveldescPK.menucode = :menucode"),
    @NamedQuery(name = "Tgenemenusubleveldesc.findByLevelcode", query = "SELECT t FROM Tgenemenusubleveldesc t WHERE t.tgenemenusubleveldescPK.levelcode = :levelcode"),
    @NamedQuery(name = "Tgenemenusubleveldesc.findBySublevel", query = "SELECT t FROM Tgenemenusubleveldesc t WHERE t.tgenemenusubleveldescPK.sublevel = :sublevel"),
    @NamedQuery(name = "Tgenemenusubleveldesc.findByLanguagecode", query = "SELECT t FROM Tgenemenusubleveldesc t WHERE t.tgenemenusubleveldescPK.languagecode = :languagecode"),
    @NamedQuery(name = "Tgenemenusubleveldesc.findByRecordversion", query = "SELECT t FROM Tgenemenusubleveldesc t WHERE t.recordversion = :recordversion"),
    @NamedQuery(name = "Tgenemenusubleveldesc.findByDescription", query = "SELECT t FROM Tgenemenusubleveldesc t WHERE t.description = :description")})
public class Tgenemenusubleveldesc implements Serializable {

    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected TgenemenusubleveldescPK tgenemenusubleveldescPK;
    @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 = "MENUCODE", referencedColumnName = "MENUCODE", insertable = false, updatable = false),
        @JoinColumn(name = "LEVELCODE", referencedColumnName = "LEVELCODE", insertable = false, updatable = false),
        @JoinColumn(name = "SUBLEVEL", referencedColumnName = "SUBLEVEL", insertable = false, updatable = false)})
    @ManyToOne(optional = false)
    private Tgenemenusublevel tgenemenusublevel;

    public Tgenemenusubleveldesc() {
    }

    public Tgenemenusubleveldesc(TgenemenusubleveldescPK tgenemenusubleveldescPK) {
        this.tgenemenusubleveldescPK = tgenemenusubleveldescPK;
    }

    public Tgenemenusubleveldesc(int menucode, int levelcode, int sublevel, String languagecode) {
        this.tgenemenusubleveldescPK = new TgenemenusubleveldescPK(menucode, levelcode, sublevel, languagecode);
    }

    public TgenemenusubleveldescPK getTgenemenusubleveldescPK() {
        return tgenemenusubleveldescPK;
    }

    public void setTgenemenusubleveldescPK(TgenemenusubleveldescPK tgenemenusubleveldescPK) {
        this.tgenemenusubleveldescPK = tgenemenusubleveldescPK;
    }

    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 Tgenemenusublevel getTgenemenusublevel() {
        return tgenemenusublevel;
    }

    public void setTgenemenusublevel(Tgenemenusublevel tgenemenusublevel) {
        this.tgenemenusublevel = tgenemenusublevel;
    }

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

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