class ProductVariationServiceImpl extends
		SalesManagerEntityServiceImpl<Long, ProductVariation> implements
		ProductVariationService {

	@Inject
	private ProductVariationRepository productVariationRepository;
	
	@Inject
	public ProductVariationServiceImpl(
			ProductVariationRepository productVariationSetRepository) {
		super(productVariationSetRepository);
		this.productVariationRepository = productVariationSetRepository;
	}


	@Autowired
	private PageableProductVariationRepository pageableProductVariationSetRepository;


	@Override
	public Optional<ProductVariation> getById(MerchantStore store, Long id, Language lang) {
		return productVariationRepository.findOne(store.getId(), id, lang.getId());
	}
	
	@Override
	public Optional<ProductVariation> getByCode(MerchantStore store, String code) {
		return productVariationRepository.findByCode(code, store.getId());
	}



	@Override
	public Page<ProductVariation> getByMerchant(MerchantStore store, Language language, String code, int page,
			int count) {
		Pageable p = PageRequest.of(page, count);
		return pageableProductVariationSetRepository.list(store.getId(), code, p);
	}

	@Override
	public Optional<ProductVariation> getById(MerchantStore store, Long id) {
		return productVariationRepository.findOne(store.getId(), id);
	}
	
	@Override
	public void saveOrUpdate(ProductVariation entity) throws ServiceException {<FILL_FUNCTION_BODY>}

	@Override
	public List<ProductVariation> getByIds(List<Long> ids, MerchantStore store) {
		return productVariationRepository.findByIds(store.getId(), ids);
	}



}


		//save or update (persist and attach entities
		if(entity.getId()!=null && entity.getId()>0) {

			super.update(entity);
			
		} else {
			
			super.save(entity);
			
		}
		
	
<methods>public void <init>(JpaRepository<com.salesmanager.core.model.catalog.product.variation.ProductVariation,java.lang.Long>) ,public java.lang.Long count() ,public void create(com.salesmanager.core.model.catalog.product.variation.ProductVariation) throws com.salesmanager.core.business.exception.ServiceException,public void delete(com.salesmanager.core.model.catalog.product.variation.ProductVariation) throws com.salesmanager.core.business.exception.ServiceException,public void flush() ,public com.salesmanager.core.model.catalog.product.variation.ProductVariation getById(java.lang.Long) ,public List<com.salesmanager.core.model.catalog.product.variation.ProductVariation> list() ,public void save(com.salesmanager.core.model.catalog.product.variation.ProductVariation) throws com.salesmanager.core.business.exception.ServiceException,public void saveAll(Iterable<com.salesmanager.core.model.catalog.product.variation.ProductVariation>) throws com.salesmanager.core.business.exception.ServiceException,public void update(com.salesmanager.core.model.catalog.product.variation.ProductVariation) throws com.salesmanager.core.business.exception.ServiceException<variables>private Class<com.salesmanager.core.model.catalog.product.variation.ProductVariation> objectClass,private JpaRepository<com.salesmanager.core.model.catalog.product.variation.ProductVariation,java.lang.Long> repository