Skip to content

Commit

Permalink
fix ldap findByUserIds error (apolloconfig#1910)
Browse files Browse the repository at this point in the history
Fix the issue 'Container type has already been specified as AND, cannot change it to OR'
  • Loading branch information
LabelZhou authored and nobodyiam committed Jan 24, 2019
1 parent 5e39268 commit 92e811f
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,9 @@ public List<UserInfo> findByUserIds(List<String> userIds) {
if (CollectionUtils.isEmpty(userIds)) {
return null;
} else {
ContainerCriteria criteria = ldapQueryCriteria()
.and(query().where(loginIdAttrName).is(userIds.get(0)));
ContainerCriteria criteria = query().where(loginIdAttrName).is(userIds.get(0));
userIds.stream().skip(1).forEach(userId -> criteria.or(loginIdAttrName).is(userId));
return ldapTemplate.search(criteria, ldapUserInfoMapper);
return ldapTemplate.search(ldapQueryCriteria().and(criteria), ldapUserInfoMapper);
}
}

Expand Down

0 comments on commit 92e811f

Please sign in to comment.