public class SaleServiceImpl extends Object implements SaleService
Constructor and Description |
---|
SaleServiceImpl(SaleRepository saleRepository)
Constructor
|
Modifier and Type | Method and Description |
---|---|
long |
create(Sale sale)
Creates new sale
|
void |
delete(Sale sale)
Deletes sale
|
List<Sale> |
getByFilter(SaleFilter filter)
Returns sales based on given filter
|
Sale |
getById(long id)
Return sale of given id
|
void |
update(Sale sale)
Updates sale
|
public SaleServiceImpl(SaleRepository saleRepository)
saleRepository
- sale repositorypublic long create(Sale sale) throws ServiceException
SaleService
create
in interface SaleService
sale
- Sale to be createdServiceException
- when there are any unexpected problemspublic void delete(Sale sale) throws ServiceException
SaleService
delete
in interface SaleService
sale
- Sale to be deletedServiceException
- when there are any unexpected problemspublic void update(Sale sale) throws ServiceException
SaleService
update
in interface SaleService
sale
- Sale to be updatedServiceException
- when there are any unexpected problemspublic Sale getById(long id)
SaleService
getById
in interface SaleService
id
- Id of salepublic List<Sale> getByFilter(SaleFilter filter)
SaleService
getByFilter
in interface SaleService
filter
- filter to useCopyright © 2017 Pivotal Software, Inc.. All rights reserved.