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

    @Basic(optional = false)
    @Column(name = "TNAME")
    private String tname;
    @Basic(optional = false)
    @Column(name = "ENTITY")
    private String entity;
    @Basic(optional = false)
    @Column(name = "FIELD")
    private String field;

    public TgenefieldsPK() {
    }

    public TgenefieldsPK(String tname, String entity, String field) {
        this.tname = tname;
        this.entity = entity;
        this.field = field;
    }

    public String getTname() {
        return tname;
    }

    public void setTname(String tname) {
        this.tname = tname;
    }

    public String getEntity() {
        return entity;
    }

    public void setEntity(String entity) {
        this.entity = entity;
    }

    public String getField() {
        return field;
    }

    public void setField(String field) {
        this.field = field;
    }

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

    @Override
    public String toString() {
        return "com.qsoft.rs.sincoar.model.TgenefieldsPK[ tname=" + tname + ", entity=" + entity + ", field=" + field + " ]";
    }
    
}
