PointOfEntryFacadeEjb implements PointOfEntryFacade { @Override public List<PointOfEntryDto> getAllAfter(Date date) { CriteriaBuilder cb = em.getCriteriaBuilder(); CriteriaQuery<PointOfEntryDto> cq = cb.createQuery(PointOfEntryDto.class); Root<PointOfEntry> pointOfEntry = cq.from(PointOfEntry.class); selectDtoFields(cq, pointOfEntry); Predicate filter = service.createChangeDateFilter(cb, pointOfEntry, date); if (filter != null) { cq.where(filter); } return em.createQuery(cq).getResultList(); }  static PointOfEntryReferenceDto toReferenceDto(PointOfEntry entity); @Override List<PointOfEntryReferenceDto> getAllActiveByDistrict(String districtUuid, boolean includeOthers); @Override PointOfEntryDto getByUuid(String uuid); @Override List<PointOfEntryDto> getAllAfter(Date date); @Override List<String> getAllUuids(); @Override List<PointOfEntryDto> getByUuids(List<String> uuids); @Override List<PointOfEntryReferenceDto> getByName(String name, DistrictReferenceDto district, boolean includeArchivedEntities); @Override void save(PointOfEntryDto dto); @Override void validate(PointOfEntryDto pointOfEntry); @Override List<PointOfEntryDto> getIndexList(PointOfEntryCriteria criteria, Integer first, Integer max, List<SortProperty> sortProperties); @Override long count(PointOfEntryCriteria criteria); @Override void archive(String pointOfEntryUuid); @Override void dearchive(String pointOfEntryUuid); @Override boolean hasArchivedParentInfrastructure(Collection<String> pointOfEntryUuids);  }
@Test public void testGetAllAfter() throws InterruptedException { Region region = creator.createRegion("region"); District district = creator.createDistrict("district", region); creator.createPointOfEntry("pointOfEntry1", region, district); getPointOfEntryService().doFlush(); Date date = new Date(); List<PointOfEntryDto> results = getPointOfEntryFacade().getAllAfter(date); assertEquals(0, results.size()); Thread.sleep(1); String pointOfEntryName = "pointOfEntry2"; creator.createPointOfEntry(pointOfEntryName, region, district); results = getPointOfEntryFacade().getAllAfter(date); assertEquals(1, results.size()); assertEquals(pointOfEntryName, results.get(0).getName()); assertEquals(district.getUuid(), results.get(0).getDistrict().getUuid()); assertEquals(region.getUuid(), results.get(0).getRegion().getUuid()); }