Exemplo n.º 1
0
 @Override
 public boolean update(BookForm book) {
   Book bookToUpdate = getBookByName(book.getTitle());
   bookToUpdate.setAuthor(authorService.getAuthorBy(book.getAuthorId()));
   bookToUpdate.setGenre(book.getGenre());
   return bookDAO.update(bookToUpdate);
 }
Exemplo n.º 2
0
 @Override
 public boolean save(BookForm book) {
   Book bookToSave = new Book();
   bookToSave.setGenre(book.getGenre());
   bookToSave.setTitle(book.getTitle());
   bookToSave.setAuthor(authorService.getAuthorBy(book.getAuthorId()));
   return bookDAO.save(bookToSave);
 }