### Question:
BookDaoImpl implements BookDao { @SuppressWarnings("unchecked") @Override public List<Book> query(int start, int pagesize) { return getSession().createCriteria(Book.class).setFirstResult(start).setMaxResults(pagesize).list(); }  @Override void add(Book book); @SuppressWarnings("unchecked") @Override List<Book> query(int start, int pagesize); @Override void update(Book book); @Override void delete(Book book); @Override void delete(int id); @Override QueryResult<Book> query(String keyword, int start, int pagesize,Analyzer analyzer,String...field); @Override Book load(int id);  }### Answer:
@Test public void query(){ List<Book> list = bookDao.query(5, 5); for (Book book : list) { System.out.println(book.getName()); } }
@Test public void search(){ int start=0; int pagesize=5; Analyzer analyzer=new PaodingAnalyzer(); String[] field=new String[]{"name","description","authors.name"}; QueryResult<Book> queryResult= null; try { queryResult = bookDao.query("实战", start, pagesize, analyzer, field); } catch (Exception e) { e.printStackTrace(); } System.out.println("共检索到["+queryResult.getSearchresultsize()+"]条记录!"); for (Book book : queryResult.getSearchresult()) { System.out.println("书名:"+book.getName()+"\n描述:"+book.getDescription()+"\n出版日期:"+book.getPublicationDate()); System.out.println("----------------------------------------------------------"); } }