@Test public void testfindPersonEnrollments() { final String uuid = "2d359911-0977-418a-9490-57e8252b1a42"; List<Enrollment> enrollments = jpaEnrollmentMapper.findPersonEnrollmentsByOpenSocialId(uuid); assertTrue("No Enrollments found for person with open social id 2d359911-0977-418a-9490-57e8252b1a42", enrollments.size() > 0); assertEquals("Incorrect school name returned", "school_name_1", enrollments.get(0).getSchoolName()); assertEquals("Expected enrollment to contain activity", 1, enrollments.get(0).getActivities().size()); assertEquals("Expected enrollment to contain area of study", 1, enrollments.get(0).getAreasOfStudy().size()); }
@SuppressWarnings("unchecked") public List<Enrollment> findPersonEnrollmentsByOpenSocialId(final String inOpenSocialId) { Query q = getEntityManager().createQuery( "from Enrollment e where e.person.openSocialId = :openSocialId order by e.gradDate desc").setParameter( "openSocialId", inOpenSocialId); return q.getResultList(); }
EnrollmentMapper extends DomainEntityMapper<Enrollment> { @SuppressWarnings("unchecked") public List<Enrollment> findPersonEnrollmentsByOpenSocialId(final String inOpenSocialId) { Query q = getEntityManager().createQuery( "from Enrollment e where e.person.openSocialId = :openSocialId order by e.gradDate desc").setParameter( "openSocialId", inOpenSocialId); return q.getResultList(); } }
EnrollmentMapper extends DomainEntityMapper<Enrollment> { @SuppressWarnings("unchecked") public List<Enrollment> findPersonEnrollmentsByOpenSocialId(final String inOpenSocialId) { Query q = getEntityManager().createQuery( "from Enrollment e where e.person.openSocialId = :openSocialId order by e.gradDate desc").setParameter( "openSocialId", inOpenSocialId); return q.getResultList(); } EnrollmentMapper(final QueryOptimizer inQueryOptimizer, final PersonMapper inPersonMapper); }
EnrollmentMapper extends DomainEntityMapper<Enrollment> { @SuppressWarnings("unchecked") public List<Enrollment> findPersonEnrollmentsByOpenSocialId(final String inOpenSocialId) { Query q = getEntityManager().createQuery( "from Enrollment e where e.person.openSocialId = :openSocialId order by e.gradDate desc").setParameter( "openSocialId", inOpenSocialId); return q.getResultList(); } EnrollmentMapper(final QueryOptimizer inQueryOptimizer, final PersonMapper inPersonMapper); @SuppressWarnings("unchecked") List<Enrollment> findPersonEnrollmentsByOpenSocialId(final String inOpenSocialId); @SuppressWarnings("unchecked") List<Enrollment> findPersonEnrollmentsById(final Long inId); void delete(final long inEnrollmentId); void flush(final String uuid); }
EnrollmentMapper extends DomainEntityMapper<Enrollment> { @SuppressWarnings("unchecked") public List<Enrollment> findPersonEnrollmentsByOpenSocialId(final String inOpenSocialId) { Query q = getEntityManager().createQuery( "from Enrollment e where e.person.openSocialId = :openSocialId order by e.gradDate desc").setParameter( "openSocialId", inOpenSocialId); return q.getResultList(); } EnrollmentMapper(final QueryOptimizer inQueryOptimizer, final PersonMapper inPersonMapper); @SuppressWarnings("unchecked") List<Enrollment> findPersonEnrollmentsByOpenSocialId(final String inOpenSocialId); @SuppressWarnings("unchecked") List<Enrollment> findPersonEnrollmentsById(final Long inId); void delete(final long inEnrollmentId); void flush(final String uuid);  }