This commit is contained in:
apapachristou 2020-10-29 12:10:58 +02:00
commit 638d5ca98c
1 changed files with 6 additions and 0 deletions

View File

@ -91,6 +91,12 @@ public class MergeEmailConfirmationManager {
}); });
oldUser.setUserStatus((short)1); oldUser.setUserStatus((short)1);
oldUser.setEmail(null); oldUser.setEmail(null);
List<Credential> credentials = databaseRepository.getCredentialDao().asQueryable().where((builder, root) -> builder.equal(root.get("userInfo"), oldUser)).toList();
credentials.forEach(cred -> {
if (cred.getId() != credential.getId()) {
databaseRepository.getCredentialDao().delete(cred);
}
});
databaseRepository.getUserInfoDao().createOrUpdate(oldUser); databaseRepository.getUserInfoDao().createOrUpdate(oldUser);
} }