FlowRepositoryImpl extends HibernateDaoSupport implements FlowRepository { @Override @SuppressWarnings("unchecked") public List<Flow> findFlows(final FlowFinderCriteria finderCriteria) { return getHibernateTemplate().executeFind(new HibernateCallback() { @Override public Object doInHibernate(Session session) throws HibernateException { return execute(finderCriteria, createFlowsCriteria(finderCriteria), session, false); } }); } FlowRepositoryImpl(); @Override void initDao(); @Override void persist(Flow flow); @Override void merge(Flow flow); @Override void remove(Flow flow); @Override Flow find(Long id); @Override Flow lock(Long id); @Override int purgeFlows(FlowPurgeCriteria purgeCriteria); @Override @SuppressWarnings("unchecked") List<Flow> findFlows(final FlowFinderCriteria finderCriteria); @Override @SuppressWarnings("unchecked") List<Flow> findErrorFlows(final FlowFinderCriteria finderCriteria); @Override @SuppressWarnings("unchecked") List<Flow> findUnackFlows(final FlowFinderCriteria finderCriteria); @Override @SuppressWarnings("unchecked") List<Long> findFlowIds(final FlowFinderCriteria finderCriteria); @Override @SuppressWarnings("unchecked") List<Long> findErrorFlowIds(final FlowFinderCriteria finderCriteria); @Override @SuppressWarnings("unchecked") List<Long> findUnackFlowIds(final FlowFinderCriteria finderCriteria);  }
@Test public void testFindFlowsVarSince() throws Exception { Flow flow = persistFlow("blah"); Date d1 = flow.getCreationTime(); Date d2 = new Date(d1.getTime() + 1L); testTransactionManager.commitTransaction(); testTransactionManager.beginTransaction(); List<Flow> flows = flowRepository.findFlows(new FlowFinderCriteria(d1, null, "test")); assertEquals(1, flows.size()); assertTrue(flows.contains(flow)); flows = flowRepository.findFlows(new FlowFinderCriteria(d1, null, "wrong")); assertEquals(0, flows.size()); flows = flowRepository.findFlows(new FlowFinderCriteria(d2, null, "test")); assertEquals(0, flows.size()); }