No finder method available for users with criteria group and membershiptype
Issue
- We want to find the collection of users within a specific group with an specific memebershiptype. Currently we use the following code to find the first user:
OrganizationService os=(OrganizationService) ExoContainerContext.getCurrentContainer().getComponentInstanceOfType( OrganizationService.class);
Collection<Membership> results =os.getMembershipHandler().findMembershipsByGroup(currectGroup);
for (final Membership msi : results) {
if (MAIN_USER.equals(msi.getMembershipType())) {
userName = membership.getUserName();
break;
}
}
We expect performance problems with this approach, hence we rather want to do something like this:
Collection<User> results =os.getUserHandler().findUsersByGroupAndMembershiptype(currectGroup, MAIN_USER); // where MAIN_USER is the memebershiptype we are looking for in the given group
Environment
- JBoss Enterprise Portal Platform (EPP) 5.2.2
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.