コード例 #1
0
 @Override
 public Number countBooksForCatalog(CategoryEntity categoryEntity, BookStatusesEnum status)
     throws ForbiddenException, AuthRequiredException {
   bookAvailabilityService.areBooksWithStatusAvailable(status);
   if (categoryEntity == null) {
     return bookDao.countBooks(status);
   }
   Collection<Integer> integers = Sets.newHashSet();
   if (CollectionUtils.isNotEmpty(categoryEntity.getSubcategories())) {
     for (SubCategoryEntity sce : categoryEntity.getSubcategories()) integers.add(sce.getId());
   }
   return bookDao.countBySubCategories(integers, status);
 }
コード例 #2
0
 @Override
 public Number countBooksForCatalog(SubCategoryEntity subCategoryEntity, BookStatusesEnum status)
     throws ForbiddenException, AuthRequiredException {
   bookAvailabilityService.areBooksWithStatusAvailable(status);
   if (subCategoryEntity == null) {
     throw new IllegalArgumentException();
   }
   Collection<Integer> integers = Sets.newHashSet();
   integers.add(subCategoryEntity.getId());
   return bookDao.countBySubCategories(integers, status);
 }