/*
 * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
 * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
 */
package com.qsoft.rs.sincoar.model;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author developer2
 */
@Embeddable
public class TcustbalancePK implements Serializable {

    @Basic(optional = false)
    @Column(name = "PERSONCODE")
    private long personcode;
    @Basic(optional = false)
    @Column(name = "BALANCEDATE")
    @Temporal(TemporalType.TIMESTAMP)
    private Date balancedate;

    public TcustbalancePK() {
    }

    public TcustbalancePK(long personcode, Date balancedate) {
        this.personcode = personcode;
        this.balancedate = balancedate;
    }

    public long getPersoncode() {
        return personcode;
    }

    public void setPersoncode(long personcode) {
        this.personcode = personcode;
    }

    public Date getBalancedate() {
        return balancedate;
    }

    public void setBalancedate(Date balancedate) {
        this.balancedate = balancedate;
    }

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

    @Override
    public String toString() {
        return "com.qsoft.rs.sincoar.model.TcustbalancePK[ personcode=" + personcode + ", balancedate=" + balancedate + " ]";
    }
    
}
