CrudDAO { @Transactional protected void create(E entity) { entityManagerProvider.get().persist(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 testCreate() { createSingleRecord(); Assert.assertTrue(repositoryVersionDAO.findAll().size() == 1); createSingleRecord(); Assert.assertTrue(repositoryVersionDAO.findAll().size() == 2); }