@Test public void 모든_품목_불러오기() { System.out.println("모든 품목 불러오기 시작"); Page<Product> products = productService.getProductList(0); for (Product product : products) { System.out.println(product.toString()); } }
@Transactional public Page<Product> getProductList(int startPage) { Pageable pageable = PageRequest.of(startPage, pageSize); Page<Product> products = productRepository.findProducts(pageable); return products; }
ProductService { @Transactional public Page<Product> getProductList(int startPage) { Pageable pageable = PageRequest.of(startPage, pageSize); Page<Product> products = productRepository.findProducts(pageable); return products; } }
ProductService { @Transactional public Page<Product> getProductList(int startPage) { Pageable pageable = PageRequest.of(startPage, pageSize); Page<Product> products = productRepository.findProducts(pageable); return products; } ProductService(ProductRepository productRepository); }
ProductService { @Transactional public Page<Product> getProductList(int startPage) { Pageable pageable = PageRequest.of(startPage, pageSize); Page<Product> products = productRepository.findProducts(pageable); return products; } ProductService(ProductRepository productRepository); @Transactional Page<Product> getProductList(int startPage); @Transactional Page<Product> getProductList(Long superiorId, int start); @Transactional Page<Product> getProductList(String searchWord, int start); }
ProductService { @Transactional public Page<Product> getProductList(int startPage) { Pageable pageable = PageRequest.of(startPage, pageSize); Page<Product> products = productRepository.findProducts(pageable); return products; } ProductService(ProductRepository productRepository); @Transactional Page<Product> getProductList(int startPage); @Transactional Page<Product> getProductList(Long superiorId, int start); @Transactional Page<Product> getProductList(String searchWord, int start);  }