use of org.olat.modules.lecture.model.LectureBlockToGroupImpl in project openolat by klemens.
the class LectureBlockToGroupDAO method remove.
public void remove(LectureBlockToGroup lectureBlockToGroup) {
LectureBlockToGroupImpl ref = dbInstance.getCurrentEntityManager().getReference(LectureBlockToGroupImpl.class, lectureBlockToGroup.getKey());
dbInstance.getCurrentEntityManager().remove(ref);
}
use of org.olat.modules.lecture.model.LectureBlockToGroupImpl in project openolat by klemens.
the class LectureBlockToGroupDAO method createAndPersist.
public LectureBlockToGroup createAndPersist(LectureBlock lectureBlock, Group group) {
LectureBlockToGroupImpl blockToGroup = new LectureBlockToGroupImpl();
blockToGroup.setLectureBlock(lectureBlock);
blockToGroup.setGroup(group);
dbInstance.getCurrentEntityManager().persist(blockToGroup);
return blockToGroup;
}
use of org.olat.modules.lecture.model.LectureBlockToGroupImpl in project OpenOLAT by OpenOLAT.
the class LectureBlockDAOTest method addGroup.
@Test
public void addGroup() {
RepositoryEntry entry = JunitTestHelper.createAndPersistRepositoryEntry();
LectureBlock lectureBlock = lectureBlockDao.createLectureBlock(entry);
lectureBlock.setStartDate(new Date());
lectureBlock.setEndDate(new Date());
lectureBlock.setTitle("Hello lecturers");
lectureBlock = lectureBlockDao.update(lectureBlock);
dbInstance.commitAndCloseSession();
Group defGroup = repositoryEntryRelationDao.getDefaultGroup(entry);
lectureBlockDao.addGroupToLectureBlock(lectureBlock, defGroup);
dbInstance.commitAndCloseSession();
LectureBlockImpl reloadedLectureBlock = (LectureBlockImpl) lectureBlockDao.loadByKey(lectureBlock.getKey());
Set<LectureBlockToGroup> blockToGroupSet = reloadedLectureBlock.getGroups();
Assert.assertNotNull(blockToGroupSet);
Assert.assertEquals(1, blockToGroupSet.size());
LectureBlockToGroupImpl defBlockToGroup = (LectureBlockToGroupImpl) blockToGroupSet.iterator().next();
Assert.assertEquals(defGroup, defBlockToGroup.getGroup());
Assert.assertEquals(lectureBlock, defBlockToGroup.getLectureBlock());
}
use of org.olat.modules.lecture.model.LectureBlockToGroupImpl in project OpenOLAT by OpenOLAT.
the class LectureBlockToGroupDAO method remove.
public void remove(LectureBlockToGroup lectureBlockToGroup) {
LectureBlockToGroupImpl ref = dbInstance.getCurrentEntityManager().getReference(LectureBlockToGroupImpl.class, lectureBlockToGroup.getKey());
dbInstance.getCurrentEntityManager().remove(ref);
}
use of org.olat.modules.lecture.model.LectureBlockToGroupImpl in project OpenOLAT by OpenOLAT.
the class LectureBlockToGroupDAO method createAndPersist.
public LectureBlockToGroup createAndPersist(LectureBlock lectureBlock, Group group) {
LectureBlockToGroupImpl blockToGroup = new LectureBlockToGroupImpl();
blockToGroup.setLectureBlock(lectureBlock);
blockToGroup.setGroup(group);
dbInstance.getCurrentEntityManager().persist(blockToGroup);
return blockToGroup;
}
Aggregations