Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SAK-47604 GB Adding or removing a TA's permissions causes duplicate values #11712

Merged
merged 5 commits into from
Jul 7, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public Iterable<T> findAllById(Iterable<ID> ids) {

List<T> list = new ArrayList<>();
if (ids != null) {
ids.forEach(id -> findById(id).ifPresent(found -> list.add(found)));
ids.forEach(id -> findById(id).ifPresent(list::add));
}
return list;
}
Expand All @@ -137,9 +137,9 @@ public void delete(T entity) {
Session session = sessionFactory.getCurrentSession();

try {
session.delete(entity);
findById(entity.getId()).ifPresent(session::delete);
} catch (Exception he) {
ern marked this conversation as resolved.
Show resolved Hide resolved
session.delete(session.merge(entity));
he.printStackTrace();
zhuoY121 marked this conversation as resolved.
Show resolved Hide resolved
}
}

Expand All @@ -161,7 +161,7 @@ public void deleteAll(Iterable<? extends T> entities) {
@Override
@Transactional
public void deleteById(ID id) {
findById(id).ifPresent(found -> delete(found));
findById(id).ifPresent(this::delete);
}

/**
Expand Down