instead of iterating through qureries, pass the list of access types to the DAO and execute a single query.