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

    @Basic(optional = false)
    @Column(name = "USERCODE")
    private String usercode;
    @Basic(optional = false)
    @Column(name = "GROUPCODE")
    private String groupcode;
    @Basic(optional = false)
    @Column(name = "COMPANYCODE")
    private long companycode;

    public TbpmgroupsusersPK() {
    }

    public TbpmgroupsusersPK(String usercode, String groupcode, long companycode) {
        this.usercode = usercode;
        this.groupcode = groupcode;
        this.companycode = companycode;
    }

    public String getUsercode() {
        return usercode;
    }

    public void setUsercode(String usercode) {
        this.usercode = usercode;
    }

    public String getGroupcode() {
        return groupcode;
    }

    public void setGroupcode(String groupcode) {
        this.groupcode = groupcode;
    }

    public long getCompanycode() {
        return companycode;
    }

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

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

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