Пример #1
0
 public void updateUser(User user, String newPassword) {
   User find = userFacade.find(user.getId());
   find.setUsername(user.getUsername());
   find.setEmail(user.getEmail());
   if (!newPassword.equals("")) {
     find.setPassword(newPassword);
   }
 }
Пример #2
0
 public User getUser(String userName) {
   List<User> users = userFacade.findAll();
   User user = null;
   for (User u : users) {
     if (u.getUsername().equals(userName)) user = u;
   }
   return user;
 }
Пример #3
0
 public void deleteUser(long id) {
   User user = userFacade.find(id);
   if (user != null) {
     userFacade.remove(user);
   }
 }
Пример #4
0
 public List<User> listUsers() {
   return userFacade.findAll();
 }
Пример #5
0
 public void registerUser(User user) {
   userFacade.create(user);
 }