@Transactional @Override public UserDto findByNick(String nick) { User user = userDao.findByNick(nick); UserRole userRole = userRoleDao.findByUser(user); UserDto userDto = userConverter.userEntityToDto(user); userDto.setRole(userRole.getRole()); return userDto; }
@Transactional @Override public List<UserDto> findAll() { List<User> userList = userDao.findAll(); List<UserDto> resultList = new ArrayList(); for (User user : userList) { UserDto userDto = userConverter.userEntityToDto(user); UserRole userRole = userRoleDao.findByUser(user); userDto.setRole(userRole.getRole()); resultList.add(userDto); } return resultList; }