Search in sources :

Example 11 with WorkspaceMaterialReply

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

the class WorkspaceMaterialReplyDAO method listByWorkspaceMaterial.

public List<WorkspaceMaterialReply> listByWorkspaceMaterial(WorkspaceMaterial workspaceMaterial) {
    EntityManager entityManager = getEntityManager();
    CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder();
    CriteriaQuery<WorkspaceMaterialReply> criteria = criteriaBuilder.createQuery(WorkspaceMaterialReply.class);
    Root<WorkspaceMaterialReply> root = criteria.from(WorkspaceMaterialReply.class);
    criteria.select(root);
    criteria.where(criteriaBuilder.and(criteriaBuilder.equal(root.get(WorkspaceMaterialReply_.workspaceMaterial), workspaceMaterial)));
    return entityManager.createQuery(criteria).getResultList();
}
Also used : CriteriaBuilder(javax.persistence.criteria.CriteriaBuilder) EntityManager(javax.persistence.EntityManager) WorkspaceMaterialReply(fi.otavanopisto.muikku.plugins.workspace.model.WorkspaceMaterialReply)

Aggregations

WorkspaceMaterialReply (fi.otavanopisto.muikku.plugins.workspace.model.WorkspaceMaterialReply)11 WorkspaceMaterial (fi.otavanopisto.muikku.plugins.workspace.model.WorkspaceMaterial)6 UserEntity (fi.otavanopisto.muikku.model.users.UserEntity)4 WorkspaceMaterialReplyState (fi.otavanopisto.muikku.plugins.workspace.model.WorkspaceMaterialReplyState)3 EntityManager (javax.persistence.EntityManager)3 CriteriaBuilder (javax.persistence.criteria.CriteriaBuilder)3 WorkspaceEntity (fi.otavanopisto.muikku.model.workspace.WorkspaceEntity)2 WorkspaceMaterialEvaluation (fi.otavanopisto.muikku.plugins.evaluation.model.WorkspaceMaterialEvaluation)2 ArrayList (java.util.ArrayList)2 WorkspaceUserEntity (fi.otavanopisto.muikku.model.workspace.WorkspaceUserEntity)1 SupplementationRequest (fi.otavanopisto.muikku.plugins.evaluation.model.SupplementationRequest)1 RestAssignment (fi.otavanopisto.muikku.plugins.evaluation.rest.model.RestAssignment)1 RestSupplementationRequest (fi.otavanopisto.muikku.plugins.evaluation.rest.model.RestSupplementationRequest)1 WorkspaceGradingScale (fi.otavanopisto.muikku.plugins.evaluation.rest.model.WorkspaceGradingScale)1 WorkspaceJournalEntry (fi.otavanopisto.muikku.plugins.workspace.model.WorkspaceJournalEntry)1 WorkspaceMaterialField (fi.otavanopisto.muikku.plugins.workspace.model.WorkspaceMaterialField)1 WorkspaceRootFolder (fi.otavanopisto.muikku.plugins.workspace.model.WorkspaceRootFolder)1 CompositeGradingScale (fi.otavanopisto.muikku.schooldata.entity.CompositeGradingScale)1 GradingScale (fi.otavanopisto.muikku.schooldata.entity.GradingScale)1 GradingScaleItem (fi.otavanopisto.muikku.schooldata.entity.GradingScaleItem)1