content: package com.bookstore.entity;
  
  import com.bookstore.validation.JustOneOfMany;
  
  import javax.persistence.Entity;
  import javax.persistence.FetchType;
  import javax.persistence.GeneratedValue;
  import javax.persistence.GenerationType;
  import javax.persistence.Id;
  import javax.persistence.ManyToOne;
  import java.io.Serializable;
  
  @Entity
  @JustOneOfMany // for testing the TRIGGER from data-mysql.sql you have to comment this line
  public class Review implements Serializable {
      private static final long serialVersionUID = 1L;
  
      @Id
      @GeneratedValue(strategy = GenerationType.IDENTITY)
      private Long id;
  
      private String content;
  
      @ManyToOne(fetch = FetchType.LAZY)
      private Book book;
  
      @ManyToOne(fetch = FetchType.LAZY)
      private Article article;
  
      @ManyToOne(fetch = FetchType.LAZY)
      private Magazine magazine;
  
      public Long getId() {
          return id;
      }
  
      public void setId(Long id) {
          this.id = id;
      }
  
      public String getContent() {
          return content;
      }
  
      public void setContent(String content) {
          this.content = content;
      }
  
      public Book getBook() {
          return book;
      }
  
      public void setBook(Book book) {
          this.book = book;
      }
  
      public Article getArticle() {
          return article;
      }
  
      public void setArticle(Article article) {
          this.article = article;
      }
  
      public Magazine getMagazine() {
          return magazine;
      }
  
      public void setMagazine(Magazine magazine) {
          this.magazine = magazine;
      }
  
      @Override
      public String toString() {
          return "Review{" + "id=" + id + ", content=" + content + '}';
      }
  }
  