@Test public void testGetAllUsersByName() { try { List<UsersDTO> result = userResourceFacadeImp .getAllUsersByName(user.getName()); assertEquals(user.getName(), result.get(0).getName()); } catch (PropertyNotSetException ex) { logger.error("PropertyNotSetException while fetching all user by name "+ex.getMessage()); fail("testGetAllUsersByName failed"); } }
@Override public List<UsersDTO> getAllUsersByName(String name) throws PropertyNotSetException { List<UsersDTO> dtoList = new ArrayList<UsersDTO>(); List<Users> usersList = (List<Users>) getAllByCriteria(Restrictions.eq("userName", name)); if (usersList != null && !usersList.isEmpty()){ for (Users u: usersList) { dtoList.add(new UsersDTO(u)); } } return dtoList; }
UsersResourceFacadeImp extends CoreDBServiceFacadeImp<Users, Long> implements UsersResourceFacade { @Override public List<UsersDTO> getAllUsersByName(String name) throws PropertyNotSetException { List<UsersDTO> dtoList = new ArrayList<UsersDTO>(); List<Users> usersList = (List<Users>) getAllByCriteria(Restrictions.eq("userName", name)); if (usersList != null && !usersList.isEmpty()){ for (Users u: usersList) { dtoList.add(new UsersDTO(u)); } } return dtoList; } }
UsersResourceFacadeImp extends CoreDBServiceFacadeImp<Users, Long> implements UsersResourceFacade { @Override public List<UsersDTO> getAllUsersByName(String name) throws PropertyNotSetException { List<UsersDTO> dtoList = new ArrayList<UsersDTO>(); List<Users> usersList = (List<Users>) getAllByCriteria(Restrictions.eq("userName", name)); if (usersList != null && !usersList.isEmpty()){ for (Users u: usersList) { dtoList.add(new UsersDTO(u)); } } return dtoList; } protected  UsersResourceFacadeImp(); }
UsersResourceFacadeImp extends CoreDBServiceFacadeImp<Users, Long> implements UsersResourceFacade { @Override public List<UsersDTO> getAllUsersByName(String name) throws PropertyNotSetException { List<UsersDTO> dtoList = new ArrayList<UsersDTO>(); List<Users> usersList = (List<Users>) getAllByCriteria(Restrictions.eq("userName", name)); if (usersList != null && !usersList.isEmpty()){ for (Users u: usersList) { dtoList.add(new UsersDTO(u)); } } return dtoList; } protected  UsersResourceFacadeImp(); @Override UsersDTO getUserByName(String name); @Override UsersDTO getUserById(Long id); @Override List<UsersDTO> getAllUsersByName(String name); @Override List<CollectionDTO> findAllCrisisByUserID(Long id); @Override UsersDTO addUser(UsersDTO user); @Override Integer deleteUser(Long id); @Override List<UsersDTO> findByCriteria(String columnName, Object value); @Override List<UsersDTO> getAllUsers(); }
UsersResourceFacadeImp extends CoreDBServiceFacadeImp<Users, Long> implements UsersResourceFacade { @Override public List<UsersDTO> getAllUsersByName(String name) throws PropertyNotSetException { List<UsersDTO> dtoList = new ArrayList<UsersDTO>(); List<Users> usersList = (List<Users>) getAllByCriteria(Restrictions.eq("userName", name)); if (usersList != null && !usersList.isEmpty()){ for (Users u: usersList) { dtoList.add(new UsersDTO(u)); } } return dtoList; } protected  UsersResourceFacadeImp(); @Override UsersDTO getUserByName(String name); @Override UsersDTO getUserById(Long id); @Override List<UsersDTO> getAllUsersByName(String name); @Override List<CollectionDTO> findAllCrisisByUserID(Long id); @Override UsersDTO addUser(UsersDTO user); @Override Integer deleteUser(Long id); @Override List<UsersDTO> findByCriteria(String columnName, Object value); @Override List<UsersDTO> getAllUsers();  }