/*
 * 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 depv
 */
@Embeddable
public class AbonoflPK implements Serializable {

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

    public AbonoflPK() {
    }

    public AbonoflPK(String tipo, String cabono) {
        this.tipo = tipo;
        this.cabono = cabono;
    }

    public String getTipo() {
        return tipo;
    }

    public void setTipo(String tipo) {
        this.tipo = tipo;
    }

    public String getCabono() {
        return cabono;
    }

    public void setCabono(String cabono) {
        this.cabono = cabono;
    }

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

    @Override
    public String toString() {
        return "com.cosmodas.EntCosmos.AbonoflPK[ tipo=" + tipo + ", cabono=" + cabono + " ]";
    }

}
