I am trying to return a collection of "User" objects using the following function:
Code:
public Collection loadDistinctByOrganizationAndRoles(Organization organization, Collection roles) {
Criteria criteria = getSession().createCriteria(User.class);
criteria.add(Expression.eq("assignedOrganization", organization));
criteria.add(Expression.in("roles", roles));
return criteria.list();
}
My question: is Expression.in() capable of iterating over the roles collection, or will I have to write the iteration myself to keep adding "ors" to the criteria?
Hibernate version is 3.1.3.
Jason