content: package com.example.demo.domain;
  
  import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
  import io.swagger.v3.oas.annotations.media.Schema;
  import java.io.Serializable;
  import java.time.Instant;
  import java.util.HashSet;
  import java.util.Set;
  import javax.persistence.*;
  import org.hibernate.annotations.Cache;
  import org.hibernate.annotations.CacheConcurrencyStrategy;
  
  /**
   * The Employee entity.
   */
  @Schema(description = "The Employee entity.")
  @Entity
  @Table(name = "employee")
  @Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
  public class Employee implements Serializable {
  
      private static final long serialVersionUID = 1L;
  
      @Id
      @GeneratedValue(strategy = GenerationType.IDENTITY)
      @Column(name = "id")
      private Long id;
  
      /**
       * The firstname attribute.
       */
      @Schema(description = "The firstname attribute.")
      @Column(name = "first_name")
      private String firstName;
  
      @Column(name = "last_name")
      private String lastName;
  
      @Column(name = "email")
      private String email;
  
      @Column(name = "phone_number")
      private String phoneNumber;
  
      @Column(name = "hire_date")
      private Instant hireDate;
  
      @Column(name = "salary")
      private Long salary;
  
      @Column(name = "commission_pct")
      private Long commissionPct;
  
      @OneToMany(mappedBy = "employee")
      @Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
      @JsonIgnoreProperties(value = { "tasks", "employee" }, allowSetters = true)
      private Set<Job> jobs = new HashSet<>();
  
      @ManyToOne
      @JsonIgnoreProperties(value = { "jobs", "manager", "department" }, allowSetters = true)
      private Employee manager;
  
      /**
       * Another side of the same relationship
       */
      @Schema(description = "Another side of the same relationship")
      @ManyToOne
      @JsonIgnoreProperties(value = { "location", "employees" }, allowSetters = true)
      private Department department;
  
      // jhipster-needle-entity-add-field - JHipster will add fields here
  
      public Long getId() {
          return this.id;
      }
  
      public Employee id(Long id) {
          this.setId(id);
          return this;
      }
  
      public void setId(Long id) {
          this.id = id;
      }
  
      public String getFirstName() {
          return this.firstName;
      }
  
      public Employee firstName(String firstName) {
          this.setFirstName(firstName);
          return this;
      }
  
      public void setFirstName(String firstName) {
          this.firstName = firstName;
      }
  
      public String getLastName() {
          return this.lastName;
      }
  
      public Employee lastName(String lastName) {
          this.setLastName(lastName);
          return this;
      }
  
      public void setLastName(String lastName) {
          this.lastName = lastName;
      }
  
      public String getEmail() {
          return this.email;
      }
  
      public Employee email(String email) {
          this.setEmail(email);
          return this;
      }
  
      public void setEmail(String email) {
          this.email = email;
      }
  
      public String getPhoneNumber() {
          return this.phoneNumber;
      }
  
      public Employee phoneNumber(String phoneNumber) {
          this.setPhoneNumber(phoneNumber);
          return this;
      }
  
      public void setPhoneNumber(String phoneNumber) {
          this.phoneNumber = phoneNumber;
      }
  
      public Instant getHireDate() {
          return this.hireDate;
      }
  
      public Employee hireDate(Instant hireDate) {
          this.setHireDate(hireDate);
          return this;
      }
  
      public void setHireDate(Instant hireDate) {
          this.hireDate = hireDate;
      }
  
      public Long getSalary() {
          return this.salary;
      }
  
      public Employee salary(Long salary) {
          this.setSalary(salary);
          return this;
      }
  
      public void setSalary(Long salary) {
          this.salary = salary;
      }
  
      public Long getCommissionPct() {
          return this.commissionPct;
      }
  
      public Employee commissionPct(Long commissionPct) {
          this.setCommissionPct(commissionPct);
          return this;
      }
  
      public void setCommissionPct(Long commissionPct) {
          this.commissionPct = commissionPct;
      }
  
      public Set<Job> getJobs() {
          return this.jobs;
      }
  
      public void setJobs(Set<Job> jobs) {
          if (this.jobs != null) {
              this.jobs.forEach(i -> i.setEmployee(null));
          }
          if (jobs != null) {
              jobs.forEach(i -> i.setEmployee(this));
          }
          this.jobs = jobs;
      }
  
      public Employee jobs(Set<Job> jobs) {
          this.setJobs(jobs);
          return this;
      }
  
      public Employee addJob(Job job) {
          this.jobs.add(job);
          job.setEmployee(this);
          return this;
      }
  
      public Employee removeJob(Job job) {
          this.jobs.remove(job);
          job.setEmployee(null);
          return this;
      }
  
      public Employee getManager() {
          return this.manager;
      }
  
      public void setManager(Employee employee) {
          this.manager = employee;
      }
  
      public Employee manager(Employee employee) {
          this.setManager(employee);
          return this;
      }
  
      public Department getDepartment() {
          return this.department;
      }
  
      public void setDepartment(Department department) {
          this.department = department;
      }
  
      public Employee department(Department department) {
          this.setDepartment(department);
          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 Employee)) {
              return false;
          }
          return id != null && id.equals(((Employee) 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 "Employee{" +
              "id=" + getId() +
              ", firstName='" + getFirstName() + "'" +
              ", lastName='" + getLastName() + "'" +
              ", email='" + getEmail() + "'" +
              ", phoneNumber='" + getPhoneNumber() + "'" +
              ", hireDate='" + getHireDate() + "'" +
              ", salary=" + getSalary() +
              ", commissionPct=" + getCommissionPct() +
              "}";
      }
  }
  