@Test
  public void test5Paging() {
    PaginationInfo pageInfo = new PaginationInfo();
    pageInfo.setFirstRow(0);
    pageInfo.setMaxResults(1);

    List<Employee> data = dao.getPageOfDataAll(pageInfo);
    assertNotNull(data);
    assertEquals(1, data.size());
    assertEquals(new Long(1), data.get(0).getId());

    pageInfo.setFirstRow(1);
    data = dao.getPageOfDataAll(pageInfo);
    assertNotNull(data);
    assertEquals(1, data.size());
    assertEquals(new Long(2), data.get(0).getId());
  }
  @Test
  public void test4FetchStrategies() {
    // This example should default to lazy loading and issue a query for
    // each employee's address
    List<Employee> results = dao.getEmployeesByHoursWorkedDefault(40);
    checkCities(results);
    clearSession();

    // This example should issue only a single query for employees and addresses.
    results = dao.getEmployeesByHoursWorkedJoin(40);
    checkCities(results);
    clearSession();

    // This example should for lazy loading and issue queries for
    // each employees address.
    results = dao.getEmployeesByHoursWorkedSelect(40);
    checkCities(results);
  }
  @Before
  public void setUp() {
    try {
      sessionFactory = HibernateUtility.getSessionFactory();
      dao = new HibernateEmployeeDao();
      dao.setSessionFactory(sessionFactory);

      service = new EmployeeService();
      service.setDao(dao);
    } finally {
      sessionFactory.getCurrentSession().beginTransaction();
    }
  }