/*
 * 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.math.BigDecimal;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;

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

    @Basic(optional = false)
    @Column(name = "CURRENCYCODE")
    private String currencycode;
    @Basic(optional = false)
    @Column(name = "CATALOG")
    private String catalog;
    @Basic(optional = false)
    @Column(name = "CATALOGCODE")
    private String catalogcode;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Basic(optional = false)
    @Column(name = "VALUE")
    private BigDecimal value;

    public TgenedenominationPK() {
    }

    public TgenedenominationPK(String currencycode, String catalog, String catalogcode, BigDecimal value) {
        this.currencycode = currencycode;
        this.catalog = catalog;
        this.catalogcode = catalogcode;
        this.value = value;
    }

    public String getCurrencycode() {
        return currencycode;
    }

    public void setCurrencycode(String currencycode) {
        this.currencycode = currencycode;
    }

    public String getCatalog() {
        return catalog;
    }

    public void setCatalog(String catalog) {
        this.catalog = catalog;
    }

    public String getCatalogcode() {
        return catalogcode;
    }

    public void setCatalogcode(String catalogcode) {
        this.catalogcode = catalogcode;
    }

    public BigDecimal getValue() {
        return value;
    }

    public void setValue(BigDecimal value) {
        this.value = value;
    }

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

    @Override
    public String toString() {
        return "com.qsoft.rs.sincoar.model.TgenedenominationPK[ currencycode=" + currencycode + ", catalog=" + catalog + ", catalogcode=" + catalogcode + ", value=" + value + " ]";
    }
    
}
