package com.sonymusic.dx.persistence.gras;

import jakarta.persistence.Column;
import jakarta.persistence.Embeddable;

import java.io.Serializable;

@Embeddable
public class LabelPk implements Serializable {

    private static final long serialVersionUID = 1L;

    @Column(name = "label_key")
    private String labelKey;

    @Column(name = "label_ext")
    private String labelExt;


    protected LabelPk() {
    }


    public LabelPk(String labelKey, String labelExt) {
        this.labelKey = labelKey;
        this.labelExt = labelExt;
    }


    public String getLabelKey() {
        return labelKey;
    }


    public void setLabelKey(String labelKey) {
        this.labelKey = labelKey;
    }


    public String getLabelExt() {
        return labelExt;
    }


    public void setLabelExt(String labelExt) {
        this.labelExt = labelExt;
    }


    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((labelExt == null) ? 0 : labelExt.hashCode());
        result = prime * result + ((labelKey == null) ? 0 : labelKey.hashCode());
        return result;
    }


    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;
        if (getClass() != obj.getClass())
            return false;
        final LabelPk other = (LabelPk) obj;
        if (labelExt == null) {
            if (other.labelExt != null)
                return false;
        } else if (!labelExt.equals(other.labelExt))
            return false;
        if (labelKey == null) {
            if (other.labelKey != null)
                return false;
        } else if (!labelKey.equals(other.labelKey))
            return false;
        return true;
    }


}