use of org.olat.course.nodes.projectbroker.datamodel.Project.EventType in project OpenOLAT by OpenOLAT.
the class ProjectBrokerManagerImpl method updateProjectAndInvalidateCache.
private void updateProjectAndInvalidateCache(final Project project) {
// avoid hibernate exception : object with same identifier already exist in session.
// reload object from db, because project is a detached object but could be already in hibernate session
Project reloadedProject = (Project) dbInstance.loadObject(project, true);
// set all value on reloadedProject with values from updated project
reloadedProject.setTitle(project.getTitle());
reloadedProject.setState(project.getState());
for (Project.EventType eventType : Project.EventType.values()) {
reloadedProject.setProjectEvent(project.getProjectEvent(eventType));
}
reloadedProject.setMaxMembers(project.getMaxMembers());
reloadedProject.setMailNotificationEnabled(project.isMailNotificationEnabled());
reloadedProject.setDescription(project.getDescription());
for (int index = 0; index < project.getCustomFieldSize(); index++) {
reloadedProject.setCustomFieldValue(index, project.getCustomFieldValue(index));
}
reloadedProject.setAttachedFileName(project.getAttachmentFileName());
dbInstance.updateObject(reloadedProject);
// invalide with removing from cache
projectCache.remove(project.getProjectBroker().getKey().toString());
}
use of org.olat.course.nodes.projectbroker.datamodel.Project.EventType in project openolat by klemens.
the class ProjectBrokerManagerImpl method updateProjectAndInvalidateCache.
private void updateProjectAndInvalidateCache(final Project project) {
// avoid hibernate exception : object with same identifier already exist in session.
// reload object from db, because project is a detached object but could be already in hibernate session
Project reloadedProject = (Project) dbInstance.loadObject(project, true);
// set all value on reloadedProject with values from updated project
reloadedProject.setTitle(project.getTitle());
reloadedProject.setState(project.getState());
for (Project.EventType eventType : Project.EventType.values()) {
reloadedProject.setProjectEvent(project.getProjectEvent(eventType));
}
reloadedProject.setMaxMembers(project.getMaxMembers());
reloadedProject.setMailNotificationEnabled(project.isMailNotificationEnabled());
reloadedProject.setDescription(project.getDescription());
for (int index = 0; index < project.getCustomFieldSize(); index++) {
reloadedProject.setCustomFieldValue(index, project.getCustomFieldValue(index));
}
reloadedProject.setAttachedFileName(project.getAttachmentFileName());
dbInstance.updateObject(reloadedProject);
// invalide with removing from cache
projectCache.remove(project.getProjectBroker().getKey().toString());
}