/*
 * 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 AbonosPK implements Serializable {
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 6)
    @Column(name = "abono_codigo")
    private String abonoCodigo;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 2)
    @Column(name = "abono_tipo")
    private String abonoTipo;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 1)
    @Column(name = "abono_anulado")
    private String abonoAnulado;

    public AbonosPK() {
    }

    public AbonosPK(String abonoCodigo, String abonoTipo, String abonoAnulado) {
        this.abonoCodigo = abonoCodigo;
        this.abonoTipo = abonoTipo;
        this.abonoAnulado = abonoAnulado;
    }

    public String getAbonoCodigo() {
        return abonoCodigo;
    }

    public void setAbonoCodigo(String abonoCodigo) {
        this.abonoCodigo = abonoCodigo;
    }

    public String getAbonoTipo() {
        return abonoTipo;
    }

    public void setAbonoTipo(String abonoTipo) {
        this.abonoTipo = abonoTipo;
    }

    public String getAbonoAnulado() {
        return abonoAnulado;
    }

    public void setAbonoAnulado(String abonoAnulado) {
        this.abonoAnulado = abonoAnulado;
    }

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

    @Override
    public String toString() {
        return "com.cosmodas.dbcon.AbonosPK[ abonoCodigo=" + abonoCodigo + ", abonoTipo=" + abonoTipo + ", abonoAnulado=" + abonoAnulado + " ]";
    }

}
