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 TBEnvironmentUpdate.
 */
@Entity
@Table(name = "tb_environment_update")
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
@Document(indexName = "smf_tbenvironmentupdate")
public class TBEnvironmentUpdate implements Serializable {

    private static final long serialVersionUID = 1L;

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

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

    @Column(name = "times")
    private Integer times;

    @ManyToOne
    @JsonIgnoreProperties("")
    private TBEnvironmentalParameter tbEnvironmentalParameter;

    @ManyToOne
    @JsonIgnoreProperties("")
    private TBActivity tbActivity;

    @ManyToOne
    @JsonIgnoreProperties("")
    private TBEquipmentOfCustomer tbEquipmentOfCustomer;

    // 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 Double getIndex() {
        return index;
    }

    public TBEnvironmentUpdate index(Double index) {
        this.index = index;
        return this;
    }

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

    public Integer getTimes() {
        return times;
    }

    public TBEnvironmentUpdate times(Integer times) {
        this.times = times;
        return this;
    }

    public void setTimes(Integer times) {
        this.times = times;
    }

    public TBEnvironmentalParameter getTbEnvironmentalParameter() {
        return tbEnvironmentalParameter;
    }

    public void setTbEnvironmentalParameter(TBEnvironmentalParameter tbEnvironmentalParameter) {
        this.tbEnvironmentalParameter = tbEnvironmentalParameter;
    }

    public TBEnvironmentUpdate tbEnvironmentalParameter(TBEnvironmentalParameter tbEnvironmentalParameter) {
        this.tbEnvironmentalParameter = tbEnvironmentalParameter;
        return this;
    }

    public TBActivity getTbActivity() {
        return tbActivity;
    }

    public TBEnvironmentUpdate tbActivity(TBActivity tBActivity) {
        this.tbActivity = tBActivity;
        return this;
    }

    public void setTbActivity(TBActivity tBActivity) {
        this.tbActivity = tBActivity;
    }

    public TBEquipmentOfCustomer getTbEquipmentOfCustomer() {
        return tbEquipmentOfCustomer;
    }

    public TBEnvironmentUpdate tbActivity(TBEquipmentOfCustomer tbEquipmentOfCustomer) {
        this.tbEquipmentOfCustomer = tbEquipmentOfCustomer;
        return this;
    }

    public void setTbEquipmentOfCustomer(TBEquipmentOfCustomer tBEquipmentOfCustomer) {
        this.tbEquipmentOfCustomer = tBEquipmentOfCustomer;
    }
    // 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;
        }
        TBEnvironmentUpdate tBEnvironmentUpdate = (TBEnvironmentUpdate) o;
        if (tBEnvironmentUpdate.getId() == null || getId() == null) {
            return false;
        }
        return Objects.equals(getId(), tBEnvironmentUpdate.getId());
    }

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

    @Override
    public String toString() {
        return "TBEnvironmentUpdate{" +
            "id=" + getId() +
            ", index=" + getIndex() +
            ", times=" + getTimes() +
            "}";
    }
}
