@Test public void shouldCreateABook() throws Exception { Book book = new Book("The Hitchhiker's Guide to the Galaxy", 12.5F, "The Hitchhiker's Guide to the Galaxy is a science fiction comedy series created by Douglas Adams.", "1-84023-742-2", 354, false); tx.begin(); em.persist(book); tx.commit(); assertNotNull(book.getId(), "Id should not be null"); }
public Long getId() { return id; }
Book { public Long getId() { return id; } }
Book { public Long getId() { return id; } Book();  Book(String title, Float price, String description, String isbn, Integer nbOfPages, Boolean illustrations); }
Book { public Long getId() { return id; } Book();  Book(String title, Float price, String description, String isbn, Integer nbOfPages, Boolean illustrations); Long getId(); String getTitle(); void setTitle(String title); Float getPrice(); void setPrice(Float price); String getDescription(); void setDescription(String description); String getIsbn(); void setIsbn(String isbn); Integer getNbOfPages(); void setNbOfPages(Integer nbOfPages); Boolean getIllustrations(); void setIllustrations(Boolean illustrations); }
Book { public Long getId() { return id; } Book();  Book(String title, Float price, String description, String isbn, Integer nbOfPages, Boolean illustrations); Long getId(); String getTitle(); void setTitle(String title); Float getPrice(); void setPrice(Float price); String getDescription(); void setDescription(String description); String getIsbn(); void setIsbn(String isbn); Integer getNbOfPages(); void setNbOfPages(Integer nbOfPages); Boolean getIllustrations(); void setIllustrations(Boolean illustrations);  }