Search in sources :

Example 6 with AssesmentRequestNotification

use of fi.otavanopisto.muikku.plugins.timed.notifications.model.AssesmentRequestNotification in project muikku by otavanopisto.

the class AssessmentRequestNotificationDAO method listByStudentIdentifierAndDateAfter.

public List<AssesmentRequestNotification> listByStudentIdentifierAndDateAfter(String studentIdentifier, Date sent) {
    EntityManager entityManager = getEntityManager();
    CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder();
    CriteriaQuery<AssesmentRequestNotification> criteria = criteriaBuilder.createQuery(AssesmentRequestNotification.class);
    Root<AssesmentRequestNotification> root = criteria.from(AssesmentRequestNotification.class);
    criteria.select(root);
    criteria.where(criteriaBuilder.and(criteriaBuilder.equal(root.get(AssesmentRequestNotification_.studentIdentifier), studentIdentifier), criteriaBuilder.greaterThanOrEqualTo(root.get(AssesmentRequestNotification_.sent), sent)));
    return entityManager.createQuery(criteria).getResultList();
}
Also used : CriteriaBuilder(javax.persistence.criteria.CriteriaBuilder) AssesmentRequestNotification(fi.otavanopisto.muikku.plugins.timed.notifications.model.AssesmentRequestNotification) EntityManager(javax.persistence.EntityManager)

Aggregations

AssesmentRequestNotification (fi.otavanopisto.muikku.plugins.timed.notifications.model.AssesmentRequestNotification)6 EntityManager (javax.persistence.EntityManager)3 CriteriaBuilder (javax.persistence.criteria.CriteriaBuilder)3 SchoolDataIdentifier (fi.otavanopisto.muikku.schooldata.SchoolDataIdentifier)2 UserEntity (fi.otavanopisto.muikku.model.users.UserEntity)1 WorkspaceUserEntity (fi.otavanopisto.muikku.model.workspace.WorkspaceUserEntity)1 NoPassedCoursesNotification (fi.otavanopisto.muikku.plugins.timed.notifications.model.NoPassedCoursesNotification)1 StudyTimeNotification (fi.otavanopisto.muikku.plugins.timed.notifications.model.StudyTimeNotification)1 RESTPermit (fi.otavanopisto.security.rest.RESTPermit)1 ArrayList (java.util.ArrayList)1 Date (java.util.Date)1 HashMap (java.util.HashMap)1 GET (javax.ws.rs.GET)1 Path (javax.ws.rs.Path)1