/*
 * 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 DetallePremioPK implements Serializable {
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 3)
    @Column(name = "premio_codigo")
    private String premioCodigo;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 4)
    @Column(name = "articulo_codigo")
    private String articuloCodigo;

    public DetallePremioPK() {
    }

    public DetallePremioPK(String premioCodigo, String articuloCodigo) {
        this.premioCodigo = premioCodigo;
        this.articuloCodigo = articuloCodigo;
    }

    public String getPremioCodigo() {
        return premioCodigo;
    }

    public void setPremioCodigo(String premioCodigo) {
        this.premioCodigo = premioCodigo;
    }

    public String getArticuloCodigo() {
        return articuloCodigo;
    }

    public void setArticuloCodigo(String articuloCodigo) {
        this.articuloCodigo = articuloCodigo;
    }

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

    @Override
    public String toString() {
        return "com.cosmodas.dbcon.DetallePremioPK[ premioCodigo=" + premioCodigo + ", articuloCodigo=" + articuloCodigo + " ]";
    }

}
