findDepartmentByDescription
Repository
public interface ProductRepository extends CassandraRepository<Product, UUID> {
@AllowFiltering
List<Product> findProductsByDescription(String description);
}Service
public List<ProductDTO> findByDescription(String description) {
List<Product> entity;
if ("".equals(description)) {
entity = repository.findAll();
} else {
entity = repository.findProductsByDescription(description);
}
return entity.stream().map(ProductDTO::new).toList();
}Controller
Atualizado