/*
 * 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.contabilidad.EntConta;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *
 * @author obper
 */
@Embeddable
public class HPagoTemporalesPK implements Serializable {

    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 4)
    @Column(name = "emp_cod")
    private String empCod;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Basic(optional = false)
    @NotNull
    @Column(name = "pago_diurno")
    private BigDecimal pagoDiurno;
    @Basic(optional = false)
    @NotNull
    @Column(name = "fecha")
    @Temporal(TemporalType.DATE)
    private Date fecha;

    public HPagoTemporalesPK() {
    }

    public HPagoTemporalesPK(String empCod, BigDecimal pagoDiurno, Date fecha) {
        this.empCod = empCod;
        this.pagoDiurno = pagoDiurno;
        this.fecha = fecha;
    }

    public String getEmpCod() {
        return empCod;
    }

    public void setEmpCod(String empCod) {
        this.empCod = empCod;
    }

    public BigDecimal getPagoDiurno() {
        return pagoDiurno;
    }

    public void setPagoDiurno(BigDecimal pagoDiurno) {
        this.pagoDiurno = pagoDiurno;
    }

    public Date getFecha() {
        return fecha;
    }

    public void setFecha(Date fecha) {
        this.fecha = fecha;
    }

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

    @Override
    public String toString() {
        return "com.contabilidad.dbcom.HPagoTemporalesPK[ empCod=" + empCod + ", pagoDiurno=" + pagoDiurno + ", fecha=" + fecha + " ]";
    }
    
}
