Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.dekikurnia.services;
- import com.dekikurnia.entities.Product;
- import com.dekikurnia.repositories.ProductRepository;
- import java.util.List;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.stereotype.Service;
- /**
- *
- * @author dekikurnia
- */
- @Service("productService")
- public class ProductServiceImpl implements ProductService{
- private ProductRepository productRepository;
- @Autowired
- public void setProductRepository(ProductRepository productRepository) {
- this.productRepository = productRepository;
- }
- @Override
- public Iterable <Product> getAllProducts() {
- return productRepository.findAll();
- }
- @Override
- public Product getProductById(Integer id) {
- return productRepository.findOne(id);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement