content: package com.bookstore.entity;
  
  import javax.persistence.Entity;
  import javax.persistence.GeneratedValue;
  import javax.persistence.GenerationType;
  import javax.persistence.Id;
  import javax.persistence.ManyToMany;
  import java.io.Serializable;
  import java.util.HashSet;
  import java.util.Set;
  
  @Entity
  public class BookSet implements Serializable {
      private static final long serialVersionUID = 1L;
  
      @Id
      @GeneratedValue(strategy = GenerationType.IDENTITY)
      private Long id;
  
      private String title;
      private String isbn;
  
      @ManyToMany(mappedBy = "books")
      private Set<AuthorSet> authors = new HashSet<>();
  
      public Long getId() {
          return id;
      }
  
      public void setId(Long id) {
          this.id = id;
      }
  
      public String getTitle() {
          return title;
      }
  
      public void setTitle(String title) {
          this.title = title;
      }
  
      public String getIsbn() {
          return isbn;
      }
  
      public void setIsbn(String isbn) {
          this.isbn = isbn;
      }
  
      public Set<AuthorSet> getAuthors() {
          return authors;
      }
  
      public void setAuthors(Set<AuthorSet> authors) {
          this.authors = authors;
      }
  
      @Override
      public boolean equals(Object obj) {
          if (obj == null) {
              return false;
          }
          if (this == obj) {
              return true;
          }
          if (getClass() != obj.getClass()) {
              return false;
          }
  
          return id != null && id.equals(((BookSet) obj).id);
      }
  
      @Override
      public int hashCode() {
          return 2021;
      }
  
      @Override
      public String toString() {
          return "Book{" + "id=" + id + ", title=" + title + ", isbn=" + isbn + '}';
      }
  }
  