content: package com.example.demo.domain;
  
  import com.example.demo.domain.enumeration.Language;
  import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
  import java.io.Serializable;
  import java.time.Instant;
  import javax.persistence.*;
  import org.hibernate.annotations.Cache;
  import org.hibernate.annotations.CacheConcurrencyStrategy;
  
  /**
   * A JobHistory.
   */
  @Entity
  @Table(name = "job_history")
  @Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
  public class JobHistory implements Serializable {
  
      private static final long serialVersionUID = 1L;
  
      @Id
      @GeneratedValue(strategy = GenerationType.IDENTITY)
      @Column(name = "id")
      private Long id;
  
      @Column(name = "start_date")
      private Instant startDate;
  
      @Column(name = "end_date")
      private Instant endDate;
  
      @Enumerated(EnumType.STRING)
      @Column(name = "language")
      private Language language;
  
      @JsonIgnoreProperties(value = { "tasks", "employee" }, allowSetters = true)
      @OneToOne
      @JoinColumn(unique = true)
      private Job job;
  
      @JsonIgnoreProperties(value = { "location", "employees" }, allowSetters = true)
      @OneToOne
      @JoinColumn(unique = true)
      private Department department;
  
      @JsonIgnoreProperties(value = { "jobs", "manager", "department" }, allowSetters = true)
      @OneToOne
      @JoinColumn(unique = true)
      private Employee employee;
  
      // jhipster-needle-entity-add-field - JHipster will add fields here
  
      public Long getId() {
          return this.id;
      }
  
      public JobHistory id(Long id) {
          this.setId(id);
          return this;
      }
  
      public void setId(Long id) {
          this.id = id;
      }
  
      public Instant getStartDate() {
          return this.startDate;
      }
  
      public JobHistory startDate(Instant startDate) {
          this.setStartDate(startDate);
          return this;
      }
  
      public void setStartDate(Instant startDate) {
          this.startDate = startDate;
      }
  
      public Instant getEndDate() {
          return this.endDate;
      }
  
      public JobHistory endDate(Instant endDate) {
          this.setEndDate(endDate);
          return this;
      }
  
      public void setEndDate(Instant endDate) {
          this.endDate = endDate;
      }
  
      public Language getLanguage() {
          return this.language;
      }
  
      public JobHistory language(Language language) {
          this.setLanguage(language);
          return this;
      }
  
      public void setLanguage(Language language) {
          this.language = language;
      }
  
      public Job getJob() {
          return this.job;
      }
  
      public void setJob(Job job) {
          this.job = job;
      }
  
      public JobHistory job(Job job) {
          this.setJob(job);
          return this;
      }
  
      public Department getDepartment() {
          return this.department;
      }
  
      public void setDepartment(Department department) {
          this.department = department;
      }
  
      public JobHistory department(Department department) {
          this.setDepartment(department);
          return this;
      }
  
      public Employee getEmployee() {
          return this.employee;
      }
  
      public void setEmployee(Employee employee) {
          this.employee = employee;
      }
  
      public JobHistory employee(Employee employee) {
          this.setEmployee(employee);
          return this;
      }
  
      // jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here
  
      @Override
      public boolean equals(Object o) {
          if (this == o) {
              return true;
          }
          if (!(o instanceof JobHistory)) {
              return false;
          }
          return id != null && id.equals(((JobHistory) o).id);
      }
  
      @Override
      public int hashCode() {
          // see https://vladmihalcea.com/how-to-implement-equals-and-hashcode-using-the-jpa-entity-identifier/
          return getClass().hashCode();
      }
  
      // prettier-ignore
      @Override
      public String toString() {
          return "JobHistory{" +
              "id=" + getId() +
              ", startDate='" + getStartDate() + "'" +
              ", endDate='" + getEndDate() + "'" +
              ", language='" + getLanguage() + "'" +
              "}";
      }
  }
  