///////////////////
// Private Methods
///////////////////
private ProjectBroker getOrLoadProjectBoker(final Long projectBrokerId) {
// 1. check if alreday a projectBroker is in the cache
ProjectBroker projectBroker = (ProjectBroker)projectCache.get(projectBrokerId.toString());
if (projectBroker == null) {
log.debug("find no projectBroker in the cache => create a new one projectBrokerId=" + projectBrokerId);
List projectList = DBFactory.getInstance().find(
"select project from org.olat.course.nodes.projectbroker.datamodel.ProjectImpl as project" +
" where project.projectBroker.key = ?", projectBrokerId, Hibernate.LONG);
projectBroker = getProjectBroker(projectBrokerId);
projectBroker.setProjects(projectList);
projectCache.put(projectBrokerId.toString(), projectBroker);
}
return projectBroker;
}