return null;
} else {
sessionProfileId = profileIds.get(0);
}
}
SessionProfile profile = (SessionProfile) entityDao.get(SessionProfile.class,
sessionProfileId);
// workground for lazy loading
OqlBuilder<CategoryProfile> builder=OqlBuilder.from(CategoryProfile.class,"cp");
builder.where("cp.sessionProfile=:profile",profile);
Map<Long,CategoryProfile> categoryMap=MapUtil.newHashMap();
for (CategoryProfile categoryProfile: entityDao.search(builder)) {
UserCategory uc=entityDao.get(UserCategory.class, categoryProfile.getCategory().getId());
categoryProfile.setCategory(uc);
categoryMap.put(uc.getId(),categoryProfile);
}
profile.setCategoryProfiles(categoryMap);
return profile;
}