class PersistableProductVariationMapper implements Mapper<PersistableProductVariation, ProductVariation> {

	@Autowired
	private ProductOptionService productOptionService;
	
	@Autowired
	private ProductOptionValueService productOptionValueService;
	
	@Override
	public ProductVariation convert(PersistableProductVariation source, MerchantStore store, Language language) {
		
		ProductVariation variation = new ProductVariation();
		return this.merge(source, variation, store, language);

	}

	@Override
	public ProductVariation merge(PersistableProductVariation source, ProductVariation destination, MerchantStore store,
			Language language) {<FILL_FUNCTION_BODY>}

}

		Validate.notNull(destination, "ProductVariation cannot be null");
		
		destination.setId(source.getId());
		destination.setCode(source.getCode());
		destination.setMerchantStore(store);
		
		ProductOption option = productOptionService.getById(store, source.getOption());
		if(option == null) {
			throw new ConversionRuntimeException("ProductOption [" + source.getOption() + "] does not exists");
		}
		destination.setProductOption(option);
		
		ProductOptionValue optionValue = productOptionValueService.getById(store, source.getOptionValue());
		if(optionValue == null) {
			throw new ConversionRuntimeException("ProductOptionValue [" + source.getOptionValue() + "] does not exists");
		}
		destination.setProductOptionValue(optionValue);
				
		
		return destination;
		
		
	
<no_super_class>