FlowRepositoryImpl extends HibernateDaoSupport implements FlowRepository { @Override public void merge(Flow flow) { getHibernateTemplate().merge(flow); } 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 testMerge() throws Exception { Flow flow = createFlow("blah"); Date timestamp = flow.getCreationTime(); flowRepository.persist(flow); Long id = flow.getIdentifier(); testTransactionManager.commitTransaction(); testTransactionManager.beginTransaction(); flow = flowRepository.find(id); FlowPart flowPart = createFlowPart("0.2"); flowPart.setStatus(ERROR); flow.incrementReplayCount(); flow.getParts().add(flowPart); flow.setPacket("blub".getBytes()); testTransactionManager.commitTransaction(); testTransactionManager.beginTransaction(); flow = flowRepository.find(id); assertEquals(ERROR, flow.getStatus()); assertEquals(1, flow.getReplayCount()); assertEquals(timestamp, flow.getCreationTime()); assertEquals("blub", new String(flow.getPacket())); assertNotNull(flow.getPart("0.2", ERROR)); }