コード例 #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);
 }
コード例 #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);
 }
コード例 #3
0
 @Override
 public boolean delete(int id) {
   return bookDAO.delete(getBookBy(id));
 }
コード例 #4
0
 @Override
 public Book getBookByName(String title) {
   return bookDAO.getBookBy(title);
 }
コード例 #5
0
 @Override
 public Book getBookBy(int id) {
   return bookDAO.getBookBy(id);
 }
コード例 #6
0
 @Override
 public List<Book> getBooks() {
   return bookDAO.getBooks();
 }