package vn.azteam.tpf.domain;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

import javax.persistence.*;

import org.springframework.data.elasticsearch.annotations.Document;
import java.io.Serializable;
import java.util.Objects;

/**
 * A TBGuidelineDetailsObjectUpdate.
 */
@Entity
@Table(name = "tb_guideline_details_object_update")
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
@Document(indexName = "smf_tbguidelinedetailsobjectupdate")
public class TBGuidelineDetailsObjectUpdate implements Serializable {

    private static final long serialVersionUID = 1L;

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    @Column(name = "jhi_index")
    private String index;

    @ManyToOne
    @JsonIgnoreProperties("")
    private TBObjectParameter tbObjectParameter;

    @ManyToOne
    @JsonIgnoreProperties("")
    private TBGuidelineActivity tbGuidelineActivity;

    // jhipster-needle-entity-add-field - JHipster will add fields here, do not remove
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getIndex() {
        return index;
    }

    public TBGuidelineDetailsObjectUpdate index(String index) {
        this.index = index;
        return this;
    }

    public void setIndex(String index) {
        this.index = index;
    }

    public TBObjectParameter getTbObjectParameter() {
        return tbObjectParameter;
    }

    public TBGuidelineDetailsObjectUpdate tbObjectParameter(TBObjectParameter tbObjectParameter) {
        this.tbObjectParameter = tbObjectParameter;
        return this;
    }

    public void setTbObjectParameter(TBObjectParameter tbObjectParameter) {
        this.tbObjectParameter = tbObjectParameter;
    }

    public TBGuidelineActivity getTbGuidelineActivity() {
        return tbGuidelineActivity;
    }

    public TBGuidelineDetailsObjectUpdate tbGuidelineActivity(TBGuidelineActivity tbGuidelineActivity) {
        this.tbGuidelineActivity = tbGuidelineActivity;
        return this;
    }

    public void setTbGuidelineActivity(TBGuidelineActivity tbGuidelineActivity) {
        this.tbGuidelineActivity = tbGuidelineActivity;
    }

    // jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here, do not remove

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        TBGuidelineDetailsObjectUpdate tBGuidelineDetailsObjectUpdate = (TBGuidelineDetailsObjectUpdate) o;
        if (tBGuidelineDetailsObjectUpdate.getId() == null || getId() == null) {
            return false;
        }
        return Objects.equals(getId(), tBGuidelineDetailsObjectUpdate.getId());
    }

    @Override
    public int hashCode() {
        return Objects.hashCode(getId());
    }

    @Override
    public String toString() {
        return "TBGuidelineDetailsObjectUpdate{" +
            "id=" + getId() +
            ", index='" + getIndex() + "'" +
            "}";
    }
}
