EntityTransaction txn = em.getTransaction();
txn.begin();
try {
Book book = em.find(Book.class, "978-0596522728");
BookReview bookReview = new BookReview();
bookReview.setRating(5);
book.getBookReviews().add(bookReview);
// No need to explicitly persist() the BookReview
// because it is a field of Book.