content: package com.bookstore.entity;
  
  import java.io.Serializable;
  import javax.persistence.Column;
  import javax.persistence.Entity;
  import javax.persistence.GeneratedValue;
  import javax.persistence.GenerationType;
  import javax.persistence.Id;
  import org.hibernate.annotations.Generated;
  import org.hibernate.annotations.GenerationTime;
  
  @Entity
  public class Book implements Serializable {
  
      private static final long serialVersionUID = 1L;
  
      @Id
      @GeneratedValue(strategy = GenerationType.IDENTITY)
      protected Long id;
  
      private String title;
      private String isbn;
      private double price;
  
      @Generated(value = GenerationTime.ALWAYS)
      @Column(insertable = false, updatable = false /*, columnDefinition = "double AS (price - price * 0.25)"*/)
      private double discounted;
  
      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 double getPrice() {
          return price;
      }
  
      public void setPrice(double price) {
          this.price = price;
      }
  
      public double getDiscounted() {
          return discounted;
      }
  
      @Override
      public String toString() {
          return "Book{" + "id=" + id + ", title=" + title + ", isbn="
                  + isbn + ", price=" + price + ", discounted=" + discounted + '}';
      }
  }
  