Implementing Code Review comments-2
This commit is contained in:
parent
23f1333aaa
commit
bb391a389f
|
@ -13,9 +13,13 @@ import java.util.Optional;
|
||||||
@Component
|
@Component
|
||||||
public class ProductService {
|
public class ProductService {
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private ProductRepository repository;
|
private ProductRepository repository;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
public ProductService(ProductRepository repository) {
|
||||||
|
this.repository = repository;
|
||||||
|
}
|
||||||
|
|
||||||
public List<Product> findProductByName(String productName) {
|
public List<Product> findProductByName(String productName) {
|
||||||
return repository.findByProductName(productName);
|
return repository.findByProductName(productName);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue