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

    private static final long serialVersionUID = 1L;

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

    @Column(name = "worker_name")
    private String workerName;

    @Column(name = "tray_number")
    private String trayNumber;

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


    // 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 getWorkerName() {
        return workerName;
    }

    public TBNurseryDetails workerName(String workerName) {
        this.workerName = workerName;
        return this;
    }

    public void setWorkerName(String workerName) {
        this.workerName = workerName;
    }

    public String getTrayNumber() {
        return trayNumber;
    }

    public TBNurseryDetails trayNumber(String trayNumber) {
        this.trayNumber = trayNumber;
        return this;
    }

    public void setTrayNumber(String trayNumber) {
        this.trayNumber = trayNumber;
    }

    public TBActivity getTbActivity() {
        return tbActivity;
    }

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

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

  // 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;
        }
        TBNurseryDetails tBNurseryDetails = (TBNurseryDetails) o;
        if (tBNurseryDetails.getId() == null || getId() == null) {
            return false;
        }
        return Objects.equals(getId(), tBNurseryDetails.getId());
    }

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

    @Override
    public String toString() {
        return "TBNurseryDetails{" +
            "id=" + getId() +
            ", workerName='" + getWorkerName() + "'" +
            ", trayNumber='" + getTrayNumber() + "'" +
            "}";
    }
}
