use of org.olat.modules.qpool.model.PoolToItem in project OpenOLAT by OpenOLAT.
the class PoolDAO method addItemToPool.
public void addItemToPool(QuestionItemShort item, List<Pool> pools, boolean editable) {
QuestionItem lockedItem = questionItemDao.loadForUpdate(item);
for (Pool pool : pools) {
if (!isInPool(lockedItem, pool)) {
PoolToItem p2i = new PoolToItem();
p2i.setCreationDate(new Date());
p2i.setItem(lockedItem);
p2i.setEditable(editable);
p2i.setPool(pool);
dbInstance.getCurrentEntityManager().persist(p2i);
}
}
// release lock asap
dbInstance.commit();
}
use of org.olat.modules.qpool.model.PoolToItem in project openolat by klemens.
the class PoolDAO method addItemToPool.
public void addItemToPool(QuestionItemShort item, List<Pool> pools, boolean editable) {
QuestionItem lockedItem = questionItemDao.loadForUpdate(item);
for (Pool pool : pools) {
if (!isInPool(lockedItem, pool)) {
PoolToItem p2i = new PoolToItem();
p2i.setCreationDate(new Date());
p2i.setItem(lockedItem);
p2i.setEditable(editable);
p2i.setPool(pool);
dbInstance.getCurrentEntityManager().persist(p2i);
}
}
// release lock asap
dbInstance.commit();
}
Aggregations