com.parthparekh.service
Class ProductServiceImpl

java.lang.Object
  extended by com.parthparekh.service.ProductServiceImpl
All Implemented Interfaces:
ProductService

@Service
@Transactional
@Qualifier(value="default")
public class ProductServiceImpl
extends java.lang.Object
implements ProductService

Implementation for Product service


Field Summary
private  ProductRepository productRepository
           
private  ProductServiceUtils productServiceUtils
           
 
Constructor Summary
ProductServiceImpl()
           
 
Method Summary
 Product createProduct(Product product)
          creates a product with name, description and price
 java.util.List<Product> getAll()
          retrieves all the available products
 Product getProduct(java.lang.String id)
          retrieves product information from id
 Product updateProduct(java.lang.String id, Product product)
          update product information
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

productRepository

@Autowired
private ProductRepository productRepository

productServiceUtils

@Autowired
private ProductServiceUtils productServiceUtils
Constructor Detail

ProductServiceImpl

public ProductServiceImpl()
Method Detail

createProduct

public Product createProduct(Product product)
Description copied from interface: ProductService
creates a product with name, description and price

Specified by:
createProduct in interface ProductService
Parameters:
product - - product containing name, description, status and price
Returns:
returns the product persisted in db

getProduct

public Product getProduct(java.lang.String id)
Description copied from interface: ProductService
retrieves product information from id

Specified by:
getProduct in interface ProductService
Parameters:
id - - product id
Returns:
returns the product from db

getAll

public java.util.List<Product> getAll()
Description copied from interface: ProductService
retrieves all the available products

Specified by:
getAll in interface ProductService
Returns:
returns all the products stored in db

updateProduct

public Product updateProduct(java.lang.String id,
                             Product product)
Description copied from interface: ProductService
update product information

Specified by:
updateProduct in interface ProductService
Parameters:
id - - product identifier to update
product - - product object containing updated fields
Returns:
returns the updated product