96979899100101102103104105106
public void updateUser(User[] usrs) { UserDao dao= WOJServer.getInstance().getDataService().getUserDao(); for (int i = 0; i < usrs.length; i++) { User usr = usrs[i]; dao.update(usr); } LOGGER.info(usrs.length + "groups successfully updated."); } public User getUser(String login) {
9293949596979899100101102
for (int i = 0; i < selectedUsersId.length; i++) { String userId = selectedUsersId[i]; User u = userDao.getUserById(Long.valueOf(userId)); if (u!=null) { u.setGroup(g); userDao.update(u); } } } return display(); }
109110111112113114115116117118119
for (int i = 0; i < selectedUsersId.length; i++) { String userId = selectedUsersId[i]; User u = userDao.getUserById(Long.valueOf(userId)); if (u!=null) { u.setGroup(null); userDao.update(u); } } } return display(); }
3031323334353637383940
Object object = users[i]; if (object instanceof User) { User u = (User)object; uToUpdate = userDao.getUserById(new Long(u.getId())); BeanHelper.copy(object, uToUpdate, User.class); userDao.update(uToUpdate); } } } return null; }
3536373839404142434445
User u = users[i]; if (uDao.getUser(u.getLogin()) == null) { uDao.insert(u); LOGGER.debug(u + " has been inserted."); } else { uDao.update(u); LOGGER.debug(u + " has been updated."); } } LOGGER.debug(users.length + " users synchronized."); }