public BookDTO add(BookDTO dto) {
   log.info("dto.getName() = " + dto.getName());
   if (dto.getName() == null || dto.getName().equals("")) {
     return null;
   }
   Book b = bookServer.saveOrUpdate(dto.toBook());
   return BookDTO.build2DTO(b);
 }
 public List<Book> searchBook(String bookNames) {
   if (bookNames == null || "".equals(bookNames)) {
     return null;
   }
   Book book = new Book();
   book.setName(bookNames);
   PageBean<Book> bean = bookServer.queryBean(book, 1, 1000);
   List<Book> result = bean.getResult();
   return result;
 }
 public void deleteBook(int id) {
   log.info("delete id = " + id);
   bookServer.delete(id);
 }
 public List<BookDTO> getBooks() {
   return BookDTO.build2DTOs(bookServer.query());
 }