/*
 * 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.TARMSANCIONRECOMENDACION")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Tarmsancionrecomendacion.findAll", query = "SELECT t FROM Tarmsancionrecomendacion t"),
    @NamedQuery(name = "Tarmsancionrecomendacion.findByCrecomendacion", query = "SELECT t FROM Tarmsancionrecomendacion t WHERE t.crecomendacion = :crecomendacion"),
    @NamedQuery(name = "Tarmsancionrecomendacion.findByPersoncode", query = "SELECT t FROM Tarmsancionrecomendacion t WHERE t.personcode = :personcode"),
    @NamedQuery(name = "Tarmsancionrecomendacion.findByRecomendacion", query = "SELECT t FROM Tarmsancionrecomendacion t WHERE t.recomendacion = :recomendacion")})
public class Tarmsancionrecomendacion implements Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "CRECOMENDACION")
    private String crecomendacion;
    @Column(name = "PERSONCODE")
    private Long personcode;
    @Column(name = "RECOMENDACION")
    private String recomendacion;
    @JoinColumns({
        @JoinColumn(name = "CDECOMISO", referencedColumnName = "CDECOMISO"),
        @JoinColumn(name = "CSANCIONDECOMISO", referencedColumnName = "CSANCIONDECOMISO")})
    @ManyToOne
    private Tarmsanciondecomiso tarmsanciondecomiso;

    public Tarmsancionrecomendacion() {
    }

    public Tarmsancionrecomendacion(String crecomendacion) {
        this.crecomendacion = crecomendacion;
    }

    public String getCrecomendacion() {
        return crecomendacion;
    }

    public void setCrecomendacion(String crecomendacion) {
        this.crecomendacion = crecomendacion;
    }

    public Long getPersoncode() {
        return personcode;
    }

    public void setPersoncode(Long personcode) {
        this.personcode = personcode;
    }

    public String getRecomendacion() {
        return recomendacion;
    }

    public void setRecomendacion(String recomendacion) {
        this.recomendacion = recomendacion;
    }

    public Tarmsanciondecomiso getTarmsanciondecomiso() {
        return tarmsanciondecomiso;
    }

    public void setTarmsanciondecomiso(Tarmsanciondecomiso tarmsanciondecomiso) {
        this.tarmsanciondecomiso = tarmsanciondecomiso;
    }

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

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