/*
 * 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 javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
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.TARMDOCUMENTOALFRESCO")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Tarmdocumentoalfresco.findAll", query = "SELECT t FROM Tarmdocumentoalfresco t"),
    @NamedQuery(name = "Tarmdocumentoalfresco.findByDocalfrescocode", query = "SELECT t FROM Tarmdocumentoalfresco t WHERE t.docalfrescocode = :docalfrescocode"),
    @NamedQuery(name = "Tarmdocumentoalfresco.findByDocumento", query = "SELECT t FROM Tarmdocumentoalfresco t WHERE t.documento = :documento")})
public class Tarmdocumentoalfresco implements Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "DOCALFRESCOCODE")
    private Integer docalfrescocode;
    @Column(name = "DOCUMENTO")
    private String documento;
    @JoinColumns({
        @JoinColumn(name = "CATALOG", referencedColumnName = "CATALOG"),
        @JoinColumn(name = "CATALOGCODE", referencedColumnName = "CATALOGCODE")})
    @ManyToOne
    private Tgenecatalogdetail tgenecatalogdetail;
    @JoinColumn(name = "PERFIL", referencedColumnName = "MENUCODE")
    @ManyToOne
    private Tgenemenu perfil;

    public Tarmdocumentoalfresco() {
    }

    public Tarmdocumentoalfresco(Integer docalfrescocode) {
        this.docalfrescocode = docalfrescocode;
    }

    public Integer getDocalfrescocode() {
        return docalfrescocode;
    }

    public void setDocalfrescocode(Integer docalfrescocode) {
        this.docalfrescocode = docalfrescocode;
    }

    public String getDocumento() {
        return documento;
    }

    public void setDocumento(String documento) {
        this.documento = documento;
    }

    public Tgenecatalogdetail getTgenecatalogdetail() {
        return tgenecatalogdetail;
    }

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

    public Tgenemenu getPerfil() {
        return perfil;
    }

    public void setPerfil(Tgenemenu perfil) {
        this.perfil = perfil;
    }

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

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