SUPPORT-9212: fix
This commit is contained in:
parent
e0c6544e6c
commit
f8360ebf77
5 changed files with 6 additions and 6 deletions
|
|
@ -55,12 +55,12 @@ public abstract class AbstractDataDao<T extends UpdatableRecord<T>> {
|
|||
.execute();
|
||||
}
|
||||
|
||||
protected <S, F> Set<S> getValuesByField(Field<S> selectField, Field<F> filterField,
|
||||
protected <S, F> List<S> getValuesByField(Field<S> selectField, Field<F> filterField,
|
||||
F filterValue) {
|
||||
return dsl.select(selectField)
|
||||
.from(getTable())
|
||||
.where(filterField.eq(filterValue))
|
||||
.fetchSet(selectField);
|
||||
.fetch(selectField);
|
||||
}
|
||||
|
||||
public void setActiveStatus(String id, boolean isActive) {
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ public class AccountDataDao extends AbstractDataDao<AccountRecord> {
|
|||
super(dsl);
|
||||
}
|
||||
|
||||
public Set<String> getAccountIdsByPersonId(String personId) {
|
||||
public List<String> getAccountIdsByPersonId(String personId) {
|
||||
return getValuesByField(Tables.ACCOUNT.ID, Tables.ACCOUNT.PERSON_ID, personId);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ public class AccountRoleDataDao extends AbstractDataDao<AccountRoleRecord> {
|
|||
super(dsl);
|
||||
}
|
||||
|
||||
public Set<String> getRoleIdsByAccountId(String accountId) {
|
||||
public List<String> getRoleIdsByAccountId(String accountId) {
|
||||
return getValuesByField(Tables.ACCOUNT_ROLE.ROLE_ID, Tables.ACCOUNT_ROLE.ACCOUNT_ID, accountId);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ public class AccountDataProcessor implements DataProcessor<AccountData, AccountR
|
|||
}
|
||||
|
||||
private void deleteAbsentAccounts(String personId, Set<String> incomingAccountIds) {
|
||||
Set<String> existingAccountIds = dao.getAccountIdsByPersonId(personId);
|
||||
List<String> existingAccountIds = dao.getAccountIdsByPersonId(personId);
|
||||
|
||||
List<String> toDelete = existingAccountIds.stream()
|
||||
.filter(id -> !incomingAccountIds.contains(id))
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ public class AccountRoleDataProcessor implements LinkDataProcessor<AccountRoleDa
|
|||
|
||||
for (AccountData account : accounts) {
|
||||
String accountId = account.getId();
|
||||
Set<String> existingRoleIds = dao.getRoleIdsByAccountId(accountId);
|
||||
List<String> existingRoleIds = dao.getRoleIdsByAccountId(accountId);
|
||||
Set<String> incomingRoleIds = account.getRoles() == null
|
||||
? Set.of()
|
||||
: account.getRoles()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue