package com.cosmodas.EntCosmos;

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

@Embeddable
public class WcDetalleRequisicionProductopapelPK implements Serializable {

    @Basic(optional = false)
    @NotNull
    @Column(name = "idrepp")
    private int idrepp;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 5)
    @Column(name = "codigo_papeleria")
    private String codigoPapeleria;

    public WcDetalleRequisicionProductopapelPK() {
    }

    public WcDetalleRequisicionProductopapelPK(int idrepp, String codigoPapeleria) {
        this.idrepp = idrepp;
        this.codigoPapeleria = codigoPapeleria;
    }

    public int getIdrepp() {
        return idrepp;
    }

    public void setIdrepp(int idrepp) {
        this.idrepp = idrepp;
    }

    public String getCodigoPapeleria() {
        return codigoPapeleria;
    }

    public void setCodigoPapeleria(String codigoPapeleria) {
        this.codigoPapeleria = codigoPapeleria;
    }

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

    @Override
    public String toString() {
        return "com.cosmodas.dbcon.WcDetalleRequesicionProductopapelPK[ idrepp=" + idrepp + ", codigoPapeleria=" + codigoPapeleria + " ]";
    }


}
