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

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

    @Basic(optional = false)
    @Column(name = "COMPANYCODE")
    private long companycode;
    @Basic(optional = false)
    @Column(name = "AREACODE")
    private short areacode;

    public TgeneareaPK() {
    }

    public TgeneareaPK(long companycode, short areacode) {
        this.companycode = companycode;
        this.areacode = areacode;
    }

    public long getCompanycode() {
        return companycode;
    }

    public void setCompanycode(long companycode) {
        this.companycode = companycode;
    }

    public short getAreacode() {
        return areacode;
    }

    public void setAreacode(short areacode) {
        this.areacode = areacode;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) companycode;
        hash += (int) areacode;
        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 TgeneareaPK)) {
            return false;
        }
        TgeneareaPK other = (TgeneareaPK) object;
        if (this.companycode != other.companycode) {
            return false;
        }
        if (this.areacode != other.areacode) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.qsoft.rs.sincoar.model.TgeneareaPK[ companycode=" + companycode + ", areacode=" + areacode + " ]";
    }
    
}
