@Test public void testDelete() { Theme theme = null; final long themeId = 103L; theme = jpaThemeMapper.findById(themeId); jpaThemeMapper.delete(theme); try { theme = jpaThemeMapper.findById(themeId); } catch (NoResultException e) { theme = null; } catch (EntityNotFoundException e) { theme = null; } assertTrue("The theme was not deleted", theme == null); }
public void delete(final Theme inTheme) { Theme defaultTheme = findDefault(); for (Person personUser : inTheme.getUsers()) { personUser.setTheme(defaultTheme); } flush(); refresh(inTheme); getEntityManager().remove(inTheme); }
ThemeMapper extends DomainEntityMapper<Theme> implements
        GalleryItemMapper<Theme> { public void delete(final Theme inTheme) { Theme defaultTheme = findDefault(); for (Person personUser : inTheme.getUsers()) { personUser.setTheme(defaultTheme); } flush(); refresh(inTheme); getEntityManager().remove(inTheme); } }
ThemeMapper extends DomainEntityMapper<Theme> implements
        GalleryItemMapper<Theme> { public void delete(final Theme inTheme) { Theme defaultTheme = findDefault(); for (Person personUser : inTheme.getUsers()) { personUser.setTheme(defaultTheme); } flush(); refresh(inTheme); getEntityManager().remove(inTheme); } ThemeMapper(final QueryOptimizer inQueryOptimizer); }
ThemeMapper extends DomainEntityMapper<Theme> implements
        GalleryItemMapper<Theme> { public void delete(final Theme inTheme) { Theme defaultTheme = findDefault(); for (Person personUser : inTheme.getUsers()) { personUser.setTheme(defaultTheme); } flush(); refresh(inTheme); getEntityManager().remove(inTheme); } ThemeMapper(final QueryOptimizer inQueryOptimizer); Theme findByUrl(final String themeLocation); Theme findByUUID(final String uuid); Theme findDefault(); PagedSet<Theme> findForCategorySortedByPopularity(
            final String inCategory, final int inStart, final int inEnd); PagedSet<Theme> findSortedByPopularity(final int inStart,
            final int inEnd); PagedSet<Theme> findForCategorySortedByRecent(
            final String inCategory, final int inStart, final int inEnd); PagedSet<Theme> findSortedByRecent(final int inStart, final int inEnd); void delete(final Theme inTheme); }
ThemeMapper extends DomainEntityMapper<Theme> implements
        GalleryItemMapper<Theme> { public void delete(final Theme inTheme) { Theme defaultTheme = findDefault(); for (Person personUser : inTheme.getUsers()) { personUser.setTheme(defaultTheme); } flush(); refresh(inTheme); getEntityManager().remove(inTheme); } ThemeMapper(final QueryOptimizer inQueryOptimizer); Theme findByUrl(final String themeLocation); Theme findByUUID(final String uuid); Theme findDefault(); PagedSet<Theme> findForCategorySortedByPopularity(
            final String inCategory, final int inStart, final int inEnd); PagedSet<Theme> findSortedByPopularity(final int inStart,
            final int inEnd); PagedSet<Theme> findForCategorySortedByRecent(
            final String inCategory, final int inStart, final int inEnd); PagedSet<Theme> findSortedByRecent(final int inStart, final int inEnd); void delete(final Theme inTheme);  }