content: package com.bookstore.entity;
  
  import java.io.Serializable;
  import java.util.logging.Logger;
  import javax.persistence.Entity;
  import javax.persistence.GeneratedValue;
  import javax.persistence.GenerationType;
  import javax.persistence.Id;
  import javax.persistence.PostLoad;
  import javax.persistence.PostPersist;
  import javax.persistence.PostRemove;
  import javax.persistence.PostUpdate;
  import javax.persistence.PrePersist;
  import javax.persistence.PreRemove;
  import javax.persistence.PreUpdate;
  
  @Entity
  public class Author implements Serializable {
  
      private static final Logger logger = Logger.getLogger(Author.class.getName());
      private static final long serialVersionUID = 1L;
  
      @Id
      @GeneratedValue(strategy = GenerationType.IDENTITY)
      private Long id;
  
      private int age;
      private String name;
      private String genre;
  
      public Long getId() {
          return id;
      }
  
      public void setId(Long id) {
          this.id = id;
      }
  
      public String getName() {
          return name;
      }
  
      public void setName(String name) {
          this.name = name;
      }
  
      public String getGenre() {
          return genre;
      }
  
      public void setGenre(String genre) {
          this.genre = genre;
      }
  
      public int getAge() {
          return age;
      }
  
      public void setAge(int age) {
          this.age = age;
      }
  
      @PrePersist
      private void prePersist() {
          logger.info("@PrePersist callback ...");
      }
  
      @PreUpdate
      private void preUpdate() {
          logger.info("@PreUpdate callback ...");
      }
  
      @PreRemove
      private void preRemove() {
          logger.info("@PreRemove callback ...");
      }
  
      @PostLoad
      private void postLoad() {
          logger.info("@PostLoad callback ...");
      }
  
      @PostPersist
      private void postPersist() {
          logger.info("@PostPersist callback ...");
      }
  
      @PostUpdate
      private void postUpdate() {
          logger.info("@PostUpdate callback ...");
      }
  
      @PostRemove
      private void postRemove() {
          logger.info("@PostRemove callback ...");
      }
  
      @Override
      public String toString() {
          return "Author{" + "id=" + id + ", age=" + age
                  + ", name=" + name + ", genre=" + genre + '}';
      }
  }
  