Skip to content

Commit

Permalink
Refactor FENCEAuthenticationService.java for readability and maintain…
Browse files Browse the repository at this point in the history
…ability
  • Loading branch information
Gcolon021 committed May 28, 2024
1 parent b6334c4 commit ce7580e
Show file tree
Hide file tree
Showing 2 changed files with 228 additions and 211 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@

import javax.enterprise.context.ApplicationScoped;
import javax.transaction.Transactional;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.UUID;

/**
Expand All @@ -29,4 +31,10 @@ public void persistAll(List<Role> newRoles) {
}
}
}

public Set<Role> loadRolesByNames(Set<String> roleNames) {
return new HashSet<>(em.createQuery("SELECT r FROM role r WHERE r.name IN :roleNames", Role.class)
.setParameter("roleNames", roleNames)
.getResultList());
}
}
Loading

0 comments on commit ce7580e

Please sign in to comment.