// Container managed transaction public List<UserDTO> findAllUsers() { LOG.debug("findAllUsers()"); // TODO: Exception handling List<User> list = dao.findAll(); List<UserDTO> result = UserDTO.toUserDTOList(list); return result; }
public UserDTO findById(int id) { LOG.debug("find User with id=" + id); User user = dao.findById(id); return new UserDTO(user); }
public void addUser(String username, String password) { LOG.debug("addUser( " + username + ")"); String md5Password = PasswordEncoder.convertToMD5String(password); dao.createUser(username, md5Password); }