package com.sonymusic.dx.persistence.gras;

import jakarta.persistence.*;
import org.hibernate.type.YesNoConverter;

import java.io.Serializable;

@Entity
@Table(name = "vgras110")
public class ArtworkLinkingWord extends RAASClientSpecificEntity implements Serializable {
    private static final long serialVersionUID = 1L;

    @Id
    @Column(name = "link_word_key", nullable = false)
    private Long linkWordKey;

    @Column(name = "link_word_description", length = 50)
    private String linkWordDescription;

    @Column(name = "link_word_name", nullable = false, length = 50)
    private String linkWordName;

    @Column(name = "used_for_particip", length = 1)
    @Convert(converter = YesNoConverter.class)
    private Boolean usedForParticipant;

    @Column(name = "used_for_publisher", length = 1)
    @Convert(converter = YesNoConverter.class)
    private Boolean usedForPublisher;

    public Long getLinkWordKey() {
        return linkWordKey;
    }

    public void setLinkWordKey(Long linkWordKey) {
        this.linkWordKey = linkWordKey;
    }

    public String getLinkWordDescription() {
        return linkWordDescription;
    }

    public void setLinkWordDescription(String linkWordDescription) {
        this.linkWordDescription = linkWordDescription;
    }

    public String getLinkWordName() {
        return linkWordName;
    }

    public void setLinkWordName(String linkWordName) {
        this.linkWordName = linkWordName;
    }

    public Boolean getUsedForParticipant() {
        return usedForParticipant;
    }

    public void setUsedForParticipant(Boolean usedForParticipant) {
        this.usedForParticipant = usedForParticipant;
    }

    public Boolean getUsedForPublisher() {
        return usedForPublisher;
    }

    public void setUsedForPublisher(Boolean usedForPublisher) {
        this.usedForPublisher = usedForPublisher;
    }

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

    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;
        if (!(obj instanceof ArtworkLinkingWord))
            return false;
        ArtworkLinkingWord other = (ArtworkLinkingWord) obj;
        if (getLinkWordKey() == null) {
            if (other.getLinkWordKey() != null)
                return false;
        } else if (!getLinkWordKey().equals(other.getLinkWordKey()))
            return false;
        return true;
    }

}