From bb391a389f9fe800f76d94ddc3c13f2c4716b819 Mon Sep 17 00:00:00 2001 From: Ankur Gupta Date: Thu, 30 Jul 2020 01:49:05 +0530 Subject: [PATCH] Implementing Code Review comments-2 --- .../spring/data/cosmosdb/service/ProductService.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/persistence-modules/spring-data-cosmosdb/src/main/java/com/baeldung/spring/data/cosmosdb/service/ProductService.java b/persistence-modules/spring-data-cosmosdb/src/main/java/com/baeldung/spring/data/cosmosdb/service/ProductService.java index 03f3ba39cd..49d07ca5a2 100644 --- a/persistence-modules/spring-data-cosmosdb/src/main/java/com/baeldung/spring/data/cosmosdb/service/ProductService.java +++ b/persistence-modules/spring-data-cosmosdb/src/main/java/com/baeldung/spring/data/cosmosdb/service/ProductService.java @@ -13,8 +13,12 @@ import java.util.Optional; @Component public class ProductService { - @Autowired private ProductRepository repository; + + @Autowired + public ProductService(ProductRepository repository) { + this.repository = repository; + } public List findProductByName(String productName) { return repository.findByProductName(productName);