/*
 * 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.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author developer2
 */
@Entity
@Table(name="COMACO.TGENEMENUPROFILE")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Tgenemenuprofile.findAll", query = "SELECT t FROM Tgenemenuprofile t"),
    @NamedQuery(name = "Tgenemenuprofile.findByProfilecode", query = "SELECT t FROM Tgenemenuprofile t WHERE t.profilecode = :profilecode")})
public class Tgenemenuprofile implements Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "PROFILECODE")
    private String profilecode;
    @JoinColumn(name = "MENUCODE", referencedColumnName = "MENUCODE")
    @ManyToOne
    private Tgenemenu menucode;
    @JoinColumn(name = "PROFILECODE", referencedColumnName = "PROFILECODE", insertable = false, updatable = false)
    @OneToOne(optional = false)
    private Tsafeprofile tsafeprofile;

    public Tgenemenuprofile() {
    }

    public Tgenemenuprofile(String profilecode) {
        this.profilecode = profilecode;
    }

    public String getProfilecode() {
        return profilecode;
    }

    public void setProfilecode(String profilecode) {
        this.profilecode = profilecode;
    }

    public Tgenemenu getMenucode() {
        return menucode;
    }

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

    public Tsafeprofile getTsafeprofile() {
        return tsafeprofile;
    }

    public void setTsafeprofile(Tsafeprofile tsafeprofile) {
        this.tsafeprofile = tsafeprofile;
    }

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

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