This will work but not a good solution in terms of memory management. When there 1m+ users in the system, this way can cause memory issue. We need to restrict the result by using QueryOptions
Try this out. Also consider maybe excluding disable accounts or any other values to reduce your total users.
import sailpoint.object.*;
QueryOptions op = new QueryOptions();
op.add(Filter.like("testMultiValuedAttribute", "val1"));
Iterator it = context.search(Identity.class, op);
return context.countObjects(Identity.class, op); // Optional if you just want to see your result size
// Insert your while loop logic
I have tried using Filter.in() and Filter.contains() approach in QueryOptions , but when I mark an attribute as multi-valued , automatically it is becoming non-searchable attribute in IdentityMappings . So I am getting attribute not found error , therefore I have suggested this approach.
@Chathurya
Understood. For this issue, solution is to update hibernate file and DB to create named attribute and then mark it as searchable. Then it will retain the searchable status