@Transactional(readOnly = true) public Page<ProductMinDTO> findAll(String name, Pageable pageable) { Page<Product> result = repository.searchByName(name, pageable); return result.map(x -> new ProductMinDTO(x)); }
Método searchByName (ProductRepository)
Precisamos instanciar um PageImpl do tipo Product
Atualizado há 8 meses