content: package org.agoncal.book.javaee7.chapter15.ex04;
  
  import javax.persistence.Entity;
  import javax.persistence.GeneratedValue;
  import javax.persistence.Id;
  import javax.persistence.NamedQuery;
  import javax.xml.bind.annotation.XmlRootElement;
  
  /**
   * @author Antonio Goncalves
   *         APress Book - Beginning Java EE 7 with Glassfish 4
   *         http://www.apress.com/
   *         http://www.antoniogoncalves.org
   *         --
   */
  @Entity
  @NamedQuery(name = Book04.FIND_ALL, query = "SELECT b FROM Book04 b")
  @XmlRootElement
  public class Book04 {
  
      // ======================================
      // =             Attributes             =
      // ======================================
  
      public static final String FIND_ALL = "Book03.findAll";
  
      @Id
      @GeneratedValue
      private Long id;
      private String title;
      private Float price;
      private String description;
      private String isbn;
      private Integer nbOfPage;
      private Boolean illustrations;
  
      // ======================================
      // =            Constructors            =
      // ======================================
  
      public Book04() {
      }
  
      public Book04(String title, Float price, String description, String isbn, Integer nbOfPage, Boolean illustrations) {
          this.title = title;
          this.price = price;
          this.description = description;
          this.isbn = isbn;
          this.nbOfPage = nbOfPage;
          this.illustrations = illustrations;
      }
  
    // ======================================
    // =          Getters & Setters         =
    // ======================================
  
      public Long getId() {
          return id;
      }
  
      public String getTitle() {
          return title;
      }
  
      public void setTitle(String title) {
          this.title = title;
      }
  
      public Float getPrice() {
          return price;
      }
  
      public void setPrice(Float price) {
          this.price = price;
      }
  
      public String getDescription() {
          return description;
      }
  
      public void setDescription(String description) {
          this.description = description;
      }
  
      public String getIsbn() {
          return isbn;
      }
  
      public void setIsbn(String isbn) {
          this.isbn = isbn;
      }
  
      public Integer getNbOfPage() {
          return nbOfPage;
      }
  
      public void setNbOfPage(Integer nbOfPage) {
          this.nbOfPage = nbOfPage;
      }
  
      public Boolean getIllustrations() {
          return illustrations;
      }
  
      public void setIllustrations(Boolean illustrations) {
          this.illustrations = illustrations;
      }
  
      // ======================================
      // =         hash, equals, toString     =
      // ======================================
  
      @Override
      public String toString() {
          final StringBuilder sb = new StringBuilder();
          sb.append("Book");
          sb.append(", id='").append(id).append('\'');
          sb.append(", title='").append(title).append('\'');
          sb.append(", price=").append(price);
          sb.append(", description='").append(description).append('\'');
          sb.append(", isbn='").append(isbn).append('\'');
          sb.append(", nbOfPage=").append(nbOfPage);
          sb.append(", illustrations=").append(illustrations);
          sb.append('}');
          return sb.toString();
      }
  }