CrudDAO { @RequiresSession public E findByPK(K pk) { return entityManagerProvider.get().find(entityClass, pk); } 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 testFindByPK() { Assert.assertNull(repositoryVersionDAO.findByPK(FIRST_ID)); createSingleRecord(); Assert.assertNotNull(repositoryVersionDAO.findByPK(FIRST_ID)); }