CrudDAO { @Transactional public E merge(E entity) { return entityManagerProvider.get().merge(entity); } CrudDAO(Class<E> entityClass); @RequiresSession E findByPK(K pk); @RequiresSession List<E> findAll(); @RequiresSession Long findMaxId(String idColName); @Transactional E merge(E entity); @Transactional void refresh(E entity); @Transactional void remove(E entity); @Transactional void remove(Collection<E> entities); @Transactional void removeByPK(K pk);  }
@Test public void testMerge() { createSingleRecord(); RepositoryVersionEntity entity = repositoryVersionDAO.findByPK(FIRST_ID); entity.setDisplayName("newname"); repositoryVersionDAO.merge(entity); entity = repositoryVersionDAO.findByPK(FIRST_ID); Assert.assertEquals("newname", entity.getDisplayName()); }