@Test public void testDeleteAll() { shopCategoryService.deleteAll(categoryService.findById(133L)); assertNull(shopCategoryService.findByShopCategory( shopService.getById(10L), categoryService.findById(133L))); }
@Override public void deleteAll(final Category category) { if (category != null) { final Collection<ShopCategory> shopCategories = shopCategoryDao.findByCriteria( " where e.category.categoryId = ?1", category.getCategoryId()); for (ShopCategory shopCategory : shopCategories) { shopCategoryDao.delete(shopCategory); } } }
ShopCategoryServiceImpl extends BaseGenericServiceImpl<ShopCategory> implements ShopCategoryService { @Override public void deleteAll(final Category category) { if (category != null) { final Collection<ShopCategory> shopCategories = shopCategoryDao.findByCriteria( " where e.category.categoryId = ?1", category.getCategoryId()); for (ShopCategory shopCategory : shopCategories) { shopCategoryDao.delete(shopCategory); } } } }
ShopCategoryServiceImpl extends BaseGenericServiceImpl<ShopCategory> implements ShopCategoryService { @Override public void deleteAll(final Category category) { if (category != null) { final Collection<ShopCategory> shopCategories = shopCategoryDao.findByCriteria( " where e.category.categoryId = ?1", category.getCategoryId()); for (ShopCategory shopCategory : shopCategories) { shopCategoryDao.delete(shopCategory); } } } ShopCategoryServiceImpl(final GenericDAO<ShopCategory, Long> shopCategoryDao,
                                   final GenericDAO<Category, Long> categoryDao,
                                   final GenericDAO<Shop, Long> shopDao); }
ShopCategoryServiceImpl extends BaseGenericServiceImpl<ShopCategory> implements ShopCategoryService { @Override public void deleteAll(final Category category) { if (category != null) { final Collection<ShopCategory> shopCategories = shopCategoryDao.findByCriteria( " where e.category.categoryId = ?1", category.getCategoryId()); for (ShopCategory shopCategory : shopCategories) { shopCategoryDao.delete(shopCategory); } } } ShopCategoryServiceImpl(final GenericDAO<ShopCategory, Long> shopCategoryDao,
                                   final GenericDAO<Category, Long> categoryDao,
                                   final GenericDAO<Shop, Long> shopDao); @Override void deleteAll(final Category category); @Override ShopCategory findByShopCategory(final Shop shop, final Category category); @Override @CacheEvict(value = { "categoryService-topLevelCategories", "categoryService-currentCategoryMenu", "breadCrumbBuilder-breadCrumbs", "shopService-shopByCode", "shopService-shopById", "shopService-shopByDomainName", "shopService-allShops", "shopService-allShopsMap", "shopService-allShopsFulfilmentMap", "shopService-allNonSubShops", "shopService-subShopsByMaster", "shopService-shopCategoriesIds", "shopService-shopAllCategoriesIds", "categoryService-searchCategoriesIds", "categoryService-categoryNewArrivalLimit", "categoryService-categoryNewArrivalDate" }, allEntries = true) ShopCategory assignToShop(final long categoryId, final long shopId); @Override @CacheEvict(value = { "categoryService-topLevelCategories", "categoryService-currentCategoryMenu", "breadCrumbBuilder-breadCrumbs", "shopService-shopByCode", "shopService-shopById", "shopService-shopByDomainName", "shopService-allShops", "shopService-allShopsMap", "shopService-allShopsFulfilmentMap", "shopService-allNonSubShops", "shopService-subShopsByMaster", "shopService-shopCategoriesIds", "shopService-shopAllCategoriesIds", "categoryService-searchCategoriesIds", "categoryService-categoryNewArrivalLimit", "categoryService-categoryNewArrivalDate" }, allEntries = true) void unassignFromShop(final long categoryId, final long shopId); }
ShopCategoryServiceImpl extends BaseGenericServiceImpl<ShopCategory> implements ShopCategoryService { @Override public void deleteAll(final Category category) { if (category != null) { final Collection<ShopCategory> shopCategories = shopCategoryDao.findByCriteria( " where e.category.categoryId = ?1", category.getCategoryId()); for (ShopCategory shopCategory : shopCategories) { shopCategoryDao.delete(shopCategory); } } } ShopCategoryServiceImpl(final GenericDAO<ShopCategory, Long> shopCategoryDao,
                                   final GenericDAO<Category, Long> categoryDao,
                                   final GenericDAO<Shop, Long> shopDao); @Override void deleteAll(final Category category); @Override ShopCategory findByShopCategory(final Shop shop, final Category category); @Override @CacheEvict(value = { "categoryService-topLevelCategories", "categoryService-currentCategoryMenu", "breadCrumbBuilder-breadCrumbs", "shopService-shopByCode", "shopService-shopById", "shopService-shopByDomainName", "shopService-allShops", "shopService-allShopsMap", "shopService-allShopsFulfilmentMap", "shopService-allNonSubShops", "shopService-subShopsByMaster", "shopService-shopCategoriesIds", "shopService-shopAllCategoriesIds", "categoryService-searchCategoriesIds", "categoryService-categoryNewArrivalLimit", "categoryService-categoryNewArrivalDate" }, allEntries = true) ShopCategory assignToShop(final long categoryId, final long shopId); @Override @CacheEvict(value = { "categoryService-topLevelCategories", "categoryService-currentCategoryMenu", "breadCrumbBuilder-breadCrumbs", "shopService-shopByCode", "shopService-shopById", "shopService-shopByDomainName", "shopService-allShops", "shopService-allShopsMap", "shopService-allShopsFulfilmentMap", "shopService-allNonSubShops", "shopService-subShopsByMaster", "shopService-shopCategoriesIds", "shopService-shopAllCategoriesIds", "categoryService-searchCategoriesIds", "categoryService-categoryNewArrivalLimit", "categoryService-categoryNewArrivalDate" }, allEntries = true) void unassignFromShop(final long categoryId, final long shopId);  }