@Test public void testUpdateEnrollmentCollections() { final long enrollmentId = 2042L; Enrollment enrollment = jpaEnrollmentMapper.findById(enrollmentId); ArrayList<BackgroundItem> activities = new ArrayList<BackgroundItem>(3); activities.add(new BackgroundItem("a", BackgroundItemType.ACTIVITY_OR_SOCIETY)); activities.add(new BackgroundItem("b", BackgroundItemType.ACTIVITY_OR_SOCIETY)); activities.add(new BackgroundItem("c", BackgroundItemType.ACTIVITY_OR_SOCIETY)); enrollment.setActivities(activities); ArrayList<BackgroundItem> areasOfStudy = new ArrayList<BackgroundItem>(3); areasOfStudy.add(new BackgroundItem("d", BackgroundItemType.AREA_OF_STUDY)); areasOfStudy.add(new BackgroundItem("e", BackgroundItemType.AREA_OF_STUDY)); areasOfStudy.add(new BackgroundItem("f", BackgroundItemType.AREA_OF_STUDY)); areasOfStudy.add(new BackgroundItem("g", BackgroundItemType.AREA_OF_STUDY)); enrollment.setAreasOfStudy(areasOfStudy); jpaEnrollmentMapper.flush(); jpaEnrollmentMapper.getEntityManager().clear(); enrollment = jpaEnrollmentMapper.findById(enrollmentId); assertEquals("Expected enrollment to contain activity", 3, enrollment.getActivities().size()); assertEquals("Expected enrollment to contain area of study", 4, enrollment.getAreasOfStudy().size()); }
public void flush(final String uuid) { flush(); getFullTextSession().index(personMapper.findByOpenSocialId(uuid)); }
EnrollmentMapper extends DomainEntityMapper<Enrollment> { public void flush(final String uuid) { flush(); getFullTextSession().index(personMapper.findByOpenSocialId(uuid)); } }
EnrollmentMapper extends DomainEntityMapper<Enrollment> { public void flush(final String uuid) { flush(); getFullTextSession().index(personMapper.findByOpenSocialId(uuid)); } EnrollmentMapper(final QueryOptimizer inQueryOptimizer, final PersonMapper inPersonMapper); }
EnrollmentMapper extends DomainEntityMapper<Enrollment> { public void flush(final String uuid) { flush(); getFullTextSession().index(personMapper.findByOpenSocialId(uuid)); } 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> { public void flush(final String uuid) { flush(); getFullTextSession().index(personMapper.findByOpenSocialId(uuid)); } 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);  }