/*
 * 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.util.Collection;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author developer2
 */
@Entity
@Table(name="COMACO.TGENEMENU")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Tgenemenu.findAll", query = "SELECT t FROM Tgenemenu t"),
    @NamedQuery(name = "Tgenemenu.findByMenucode", query = "SELECT t FROM Tgenemenu t WHERE t.menucode = :menucode"),
    @NamedQuery(name = "Tgenemenu.findByDescription", query = "SELECT t FROM Tgenemenu t WHERE t.description = :description")})
public class Tgenemenu implements Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "MENUCODE")
    private Integer menucode;
    @Column(name = "DESCRIPTION")
    private String description;
    @OneToMany(mappedBy = "menucode")
    private Collection<Tgenemenuprofile> tgenemenuprofileCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "tgenemenu")
    private Collection<Tgenemenudesc> tgenemenudescCollection;
    @OneToMany(mappedBy = "perfil")
    private Collection<Tarmdocumentoalfresco> tarmdocumentoalfrescoCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "tgenemenu")
    private Collection<Tgenemenulevel> tgenemenulevelCollection;

    public Tgenemenu() {
    }

    public Tgenemenu(Integer menucode) {
        this.menucode = menucode;
    }

    public Integer getMenucode() {
        return menucode;
    }

    public void setMenucode(Integer menucode) {
        this.menucode = menucode;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    @XmlTransient
    public Collection<Tgenemenuprofile> getTgenemenuprofileCollection() {
        return tgenemenuprofileCollection;
    }

    public void setTgenemenuprofileCollection(Collection<Tgenemenuprofile> tgenemenuprofileCollection) {
        this.tgenemenuprofileCollection = tgenemenuprofileCollection;
    }

    @XmlTransient
    public Collection<Tgenemenudesc> getTgenemenudescCollection() {
        return tgenemenudescCollection;
    }

    public void setTgenemenudescCollection(Collection<Tgenemenudesc> tgenemenudescCollection) {
        this.tgenemenudescCollection = tgenemenudescCollection;
    }

    @XmlTransient
    public Collection<Tarmdocumentoalfresco> getTarmdocumentoalfrescoCollection() {
        return tarmdocumentoalfrescoCollection;
    }

    public void setTarmdocumentoalfrescoCollection(Collection<Tarmdocumentoalfresco> tarmdocumentoalfrescoCollection) {
        this.tarmdocumentoalfrescoCollection = tarmdocumentoalfrescoCollection;
    }

    @XmlTransient
    public Collection<Tgenemenulevel> getTgenemenulevelCollection() {
        return tgenemenulevelCollection;
    }

    public void setTgenemenulevelCollection(Collection<Tgenemenulevel> tgenemenulevelCollection) {
        this.tgenemenulevelCollection = tgenemenulevelCollection;
    }

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

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