/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.cosmodas.EntCosmos;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 * @author obper
 */
@Embeddable
public class TakeNumberPK implements Serializable {
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 6)
    @Column(name = "consultor_codigo")
    private String consultorCodigo;
    @Basic(optional = false)
    @Column(name = "idn")
    private int idn;

    public TakeNumberPK() {
    }

    public TakeNumberPK(String consultorCodigo, int idn) {
        this.consultorCodigo = consultorCodigo;
        this.idn = idn;
    }

    public String getConsultorCodigo() {
        return consultorCodigo;
    }

    public void setConsultorCodigo(String consultorCodigo) {
        this.consultorCodigo = consultorCodigo;
    }

    public int getIdn() {
        return idn;
    }

    public void setIdn(int idn) {
        this.idn = idn;
    }

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

    @Override
    public String toString() {
        return "com.cosmodas.dbcon.TakeNumberPK[ consultorCodigo=" + consultorCodigo + ", idn=" + idn + " ]";
    }

}
