Skip to content
Snippets Groups Projects
Commit 9875f32f authored by Robert Goldmann's avatar Robert Goldmann
Browse files

#765 - update missing attributes on start

parent 9e0db61d
No related branches found
No related tags found
No related merge requests found
......@@ -184,6 +184,7 @@ public class AccountService implements Resettable, AccessAllEntities<Account>, A
for(Account account : accountRepository.findAll())
{
handleNullValuesForAccountState(account);
handleNullValuesDescription(account);
accountRepository.save(account);
}
}
......@@ -193,7 +194,16 @@ public class AccountService implements Resettable, AccessAllEntities<Account>, A
if(account.getAccountState() == null)
{
account.setAccountState(AccountState.FULL_ACCESS);
LOGGER.debug(MessageFormat.format("Updated account {0}: Set missing attribute \"accountState\" to {1}", account.getName(), account.getAccountState()));
LOGGER.debug(MessageFormat.format("Updated account {0}: Set missing attribute \"accountState\" to \"{1}\"", account.getName(), account.getAccountState()));
}
}
private void handleNullValuesDescription(Account account)
{
if(account.getDescription() == null)
{
account.setDescription("");
LOGGER.debug(MessageFormat.format("Updated account {0}: Set missing attribute \"description\" to {1}", account.getName(), account.getDescription()));
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment