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 InventarioPapeleriaPK  implements Serializable {

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

    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 6)
    @Column(name = "departamento")
    private String departamento;

    public InventarioPapeleriaPK() {
    }

    public InventarioPapeleriaPK(String codigoPapeleria, String departamento) {
        this.codigoPapeleria = codigoPapeleria;
        this.departamento = departamento;
    }

    public String getCodigoPapeleria() {
        return codigoPapeleria;
    }

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

    }

    public String getDepartamento() {
        return departamento;
    }

    public void setDepartamento(String departamento) {
        this.departamento = departamento;

    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (codigoPapeleria != null ? codigoPapeleria.hashCode() : 0);
        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 InventarioPapeleriaPK)) {
            return false;
        }
        InventarioPapeleriaPK other = (InventarioPapeleriaPK) object;
        if ((this.codigoPapeleria == null && other.codigoPapeleria != null) || (this.codigoPapeleria != null && !this.codigoPapeleria.equals(other.codigoPapeleria))) {
            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.InventarioPapeleriaPK[ codigo_papeleria=" + codigoPapeleria + ", departamento=" + departamento + " ]";
    }

}
