@PreAuthorize("isAuthenticated ()") @Transactional(readOnly = true, propagation = Propagation.REQUIRED) @Cacheable(value = "product_count", key = "'all'") public int countAuthorizedProducts() { return productDao.count(); }
@PreAuthorize("hasAnyRole('ROLE_DATA_MANAGER','ROLE_SEARCH')") @Transactional(readOnly = true, propagation = Propagation.REQUIRED) @Cacheable(value = "product_count", key = "{#filter, null}") public Integer count(String filter) { return productDao.count(filter, null, null); }