criteria.add(Restrictions.in("this.id", activityIds));
final Map<Long, ActivityDTO> activityMap = new HashMap<Long, ActivityDTO>();
ModelViewResultTransformer<ActivityDTO> resultTransformer = new ModelViewResultTransformer<ActivityDTO>(
new ActivityDTOFactory());
criteria.setResultTransformer(resultTransformer);
List<ActivityDTO> results = criteria.list();
for (ActivityDTO activity : results)
{
activityMap.put(activity.getId(), activity);