Code example for SessionFactory

Methods: close

0
  } 
 
  @After 
  public void teardown() { 
    if (_sessionFactory != null)
      _sessionFactory.close();
  } 
 
  @Test
  public void test() { 
 
    assertEquals(0, _dao.getNumberOfUserRoles());
 
    UserRole adminRole = new UserRole("admin");
    UserRole userRole = new UserRole("user");
 
    _dao.saveOrUpdateUserRole(adminRole);
    _dao.saveOrUpdateUserRole(userRole);
 
    assertEquals(2, _dao.getNumberOfUserRoles());
Connect your IDE to all the code out there  Get Codota for Java