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

    private static final long serialVersionUID = 1L;

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

    @Column(name = "pixel_x")
    private Double pixelX;

    @Column(name = "pixel_y")
    private Double pixelY;

    @ManyToOne
    @JsonIgnoreProperties("")
    private TBCustomer tbCustomer;

    @ManyToOne
    @JsonIgnoreProperties("")
    private TBEntity tbEntity;

    // 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 getPixelX() {
        return pixelX;
    }

    public TBEntityLocationOfCustomer pixelX(Double pixelX) {
        this.pixelX = pixelX;
        return this;
    }

    public void setPixelX(Double pixelX) {
        this.pixelX = pixelX;
    }

    public Double getPixelY() {
        return pixelY;
    }

    public TBEntityLocationOfCustomer pixelY(Double pixelY) {
        this.pixelY = pixelY;
        return this;
    }

    public void setPixelY(Double pixelY) {
        this.pixelY = pixelY;
    }


    public TBCustomer getTbCustomer() {
        return tbCustomer;
    }

    public TBEntityLocationOfCustomer tbCustomer(TBCustomer tbCustomer) {
        this.tbCustomer = tbCustomer;
        return this;
    }

    public void setTbCustomer(TBCustomer tbCustomer) {
        this.tbCustomer = tbCustomer;
    }


    public TBEntity getTbEntity() {
        return tbEntity;
    }

    public TBEntityLocationOfCustomer tbEntity(TBEntity tbEntity) {
        this.tbEntity = tbEntity;
        return this;
    }

    public void setTbEntity(TBEntity tbEntity) {
        this.tbEntity = tbEntity;
    }

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

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

    @Override
    public String toString() {
        return "TBEntityLocationOfCustomer{" +
            "id=" + getId() +
            ", pixelX=" + getPixelX() +
            ", pixelY=" + getPixelY() +
            "}";
    }
}
