Commit f982a0d4 authored by michael.simon's avatar michael.simon
Browse files

merge user and groups with persistence manager in dao layer

parent f5b499c8
......@@ -45,13 +45,19 @@ public class GroupServiceImpl extends BaseServiceImpl<GroupEntity, Long> impleme
Set<UserEntity> usersToAdd = new HashSet<UserEntity>(newMembers);
usersToAdd.removeAll(oldMembers);
for (UserEntity user : usersToAdd)
for (UserEntity user : usersToAdd) {
user = userDao.merge(user);
group = groupDao.merge(group);
groupDao.addUserToGroup(user, group);
}
Set<UserEntity> usersToRemove = new HashSet<UserEntity>(oldMembers);
usersToRemove.removeAll(newMembers);
for (UserEntity user : usersToRemove)
for (UserEntity user : usersToRemove) {
user = userDao.merge(user);
group = groupDao.merge(group);
groupDao.removeUserGromGroup(user, group);
}
}
@Override
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment