use of org.olat.modules.qpool.model.ResourceShareImpl in project OpenOLAT by OpenOLAT.
the class QuestionItemDAO method share.
public void share(QuestionItem item, OLATResource resource) {
QuestionItem lockedItem = loadForUpdate(item);
if (!isShared(item, resource)) {
EntityManager em = dbInstance.getCurrentEntityManager();
ResourceShareImpl share = new ResourceShareImpl();
share.setCreationDate(new Date());
share.setItem(lockedItem);
share.setResource(resource);
em.persist(share);
}
// release the lock asap
dbInstance.commit();
}
use of org.olat.modules.qpool.model.ResourceShareImpl in project openolat by klemens.
the class QuestionItemDAO method share.
public void share(QuestionItem item, OLATResource resource) {
QuestionItem lockedItem = loadForUpdate(item);
if (!isShared(item, resource)) {
EntityManager em = dbInstance.getCurrentEntityManager();
ResourceShareImpl share = new ResourceShareImpl();
share.setCreationDate(new Date());
share.setItem(lockedItem);
share.setResource(resource);
em.persist(share);
}
// release the lock asap
dbInstance.commit();
}
use of org.olat.modules.qpool.model.ResourceShareImpl in project openolat by klemens.
the class QuestionItemDAO method share.
public void share(QuestionItemShort item, List<OLATResource> resources, boolean editable) {
EntityManager em = dbInstance.getCurrentEntityManager();
QuestionItem lockedItem = loadForUpdate(item);
for (OLATResource resource : resources) {
if (!isShared(lockedItem, resource)) {
ResourceShareImpl share = new ResourceShareImpl();
share.setCreationDate(new Date());
share.setItem(lockedItem);
share.setEditable(editable);
share.setResource(resource);
em.persist(share);
}
}
// release the lock asap
dbInstance.commit();
}
use of org.olat.modules.qpool.model.ResourceShareImpl in project OpenOLAT by OpenOLAT.
the class QuestionItemDAO method share.
public void share(QuestionItemShort item, List<OLATResource> resources, boolean editable) {
EntityManager em = dbInstance.getCurrentEntityManager();
QuestionItem lockedItem = loadForUpdate(item);
for (OLATResource resource : resources) {
if (!isShared(lockedItem, resource)) {
ResourceShareImpl share = new ResourceShareImpl();
share.setCreationDate(new Date());
share.setItem(lockedItem);
share.setEditable(editable);
share.setResource(resource);
em.persist(share);
}
}
// release the lock asap
dbInstance.commit();
}
Aggregations