Search in sources :

Example 21 with WorkspaceRootFolder

use of fi.otavanopisto.muikku.plugins.workspace.model.WorkspaceRootFolder in project muikku by otavanopisto.

the class WorkspaceRootFolderDAO method findByWorkspaceEntityId.

public WorkspaceRootFolder findByWorkspaceEntityId(Long workspaceEntityId) {
    EntityManager entityManager = getEntityManager();
    CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder();
    CriteriaQuery<WorkspaceRootFolder> criteria = criteriaBuilder.createQuery(WorkspaceRootFolder.class);
    Root<WorkspaceRootFolder> root = criteria.from(WorkspaceRootFolder.class);
    criteria.select(root);
    criteria.where(criteriaBuilder.equal(root.get(WorkspaceRootFolder_.workspaceEntityId), workspaceEntityId));
    return getSingleResult(entityManager.createQuery(criteria));
}
Also used : CriteriaBuilder(javax.persistence.criteria.CriteriaBuilder) EntityManager(javax.persistence.EntityManager) WorkspaceRootFolder(fi.otavanopisto.muikku.plugins.workspace.model.WorkspaceRootFolder)

Aggregations

WorkspaceRootFolder (fi.otavanopisto.muikku.plugins.workspace.model.WorkspaceRootFolder)21 WorkspaceEntity (fi.otavanopisto.muikku.model.workspace.WorkspaceEntity)14 WorkspaceMaterial (fi.otavanopisto.muikku.plugins.workspace.model.WorkspaceMaterial)14 Path (javax.ws.rs.Path)12 GET (javax.ws.rs.GET)8 RESTPermit (fi.otavanopisto.security.rest.RESTPermit)7 WorkspaceUserEntity (fi.otavanopisto.muikku.model.workspace.WorkspaceUserEntity)6 UserEntity (fi.otavanopisto.muikku.model.users.UserEntity)5 WorkspaceNode (fi.otavanopisto.muikku.plugins.workspace.model.WorkspaceNode)5 RESTPermitUnimplemented (fi.otavanopisto.muikku.rest.RESTPermitUnimplemented)5 ArrayList (java.util.ArrayList)4 POST (javax.ws.rs.POST)3 WorkspaceGradingScale (fi.otavanopisto.muikku.plugins.evaluation.rest.model.WorkspaceGradingScale)2 BinaryMaterial (fi.otavanopisto.muikku.plugins.material.model.BinaryMaterial)2 HtmlMaterial (fi.otavanopisto.muikku.plugins.material.model.HtmlMaterial)2 WorkspaceMaterialFileFieldAnswerFile (fi.otavanopisto.muikku.plugins.workspace.model.WorkspaceMaterialFileFieldAnswerFile)2 GradingScale (fi.otavanopisto.muikku.schooldata.entity.GradingScale)2 GradingScaleItem (fi.otavanopisto.muikku.schooldata.entity.GradingScaleItem)2 IOException (java.io.IOException)2 Date (java.util.Date)2