/*
 * 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 TcustbalancefinancialPK implements Serializable {

    @Basic(optional = false)
    @Column(name = "PERSONCODE")
    private long personcode;
    @Basic(optional = false)
    @Column(name = "BALANCEDATE")
    @Temporal(TemporalType.TIMESTAMP)
    private Date balancedate;
    @Basic(optional = false)
    @Column(name = "ACCOUNTCODE")
    private String accountcode;
    @Basic(optional = false)
    @Column(name = "BALANCECATALOG")
    private String balancecatalog;
    @Basic(optional = false)
    @Column(name = "BALANCECATALOGCODE")
    private String balancecatalogcode;
    @Basic(optional = false)
    @Column(name = "DATETO")
    @Temporal(TemporalType.TIMESTAMP)
    private Date dateto;

    public TcustbalancefinancialPK() {
    }

    public TcustbalancefinancialPK(long personcode, Date balancedate, String accountcode, String balancecatalog, String balancecatalogcode, Date dateto) {
        this.personcode = personcode;
        this.balancedate = balancedate;
        this.accountcode = accountcode;
        this.balancecatalog = balancecatalog;
        this.balancecatalogcode = balancecatalogcode;
        this.dateto = dateto;
    }

    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;
    }

    public String getAccountcode() {
        return accountcode;
    }

    public void setAccountcode(String accountcode) {
        this.accountcode = accountcode;
    }

    public String getBalancecatalog() {
        return balancecatalog;
    }

    public void setBalancecatalog(String balancecatalog) {
        this.balancecatalog = balancecatalog;
    }

    public String getBalancecatalogcode() {
        return balancecatalogcode;
    }

    public void setBalancecatalogcode(String balancecatalogcode) {
        this.balancecatalogcode = balancecatalogcode;
    }

    public Date getDateto() {
        return dateto;
    }

    public void setDateto(Date dateto) {
        this.dateto = dateto;
    }

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

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