class ProductAttributeServiceImpl extends SalesManagerEntityServiceImpl<Long, ProductAttribute>
		implements ProductAttributeService {

	private ProductAttributeRepository productAttributeRepository;
	@Autowired
	private PageableProductAttributeRepository pageableProductAttributeRepository;

	@Inject
	public ProductAttributeServiceImpl(ProductAttributeRepository productAttributeRepository) {
		super(productAttributeRepository);
		this.productAttributeRepository = productAttributeRepository;
	}

	@Override
	public ProductAttribute getById(Long id) {

		return productAttributeRepository.findOne(id);

	}

	@Override
	public List<ProductAttribute> getByOptionId(MerchantStore store, Long id) throws ServiceException {

		return productAttributeRepository.findByOptionId(store.getId(), id);

	}

	@Override
	public List<ProductAttribute> getByAttributeIds(MerchantStore store, Product product, List<Long> ids)
			throws ServiceException {

		return productAttributeRepository.findByAttributeIds(store.getId(), product.getId(), ids);

	}

	@Override
	public List<ProductAttribute> getByOptionValueId(MerchantStore store, Long id) throws ServiceException {

		return productAttributeRepository.findByOptionValueId(store.getId(), id);

	}

	/**
	 * Returns all product attributes
	 */
	@Override
	public Page<ProductAttribute> getByProductId(MerchantStore store, Product product, Language language, int page,
			int count) throws ServiceException {

		Pageable pageRequest = PageRequest.of(page, count);
		return pageableProductAttributeRepository.findByProductId(store.getId(), product.getId(), language.getId(),
				pageRequest);

	}

	@Override
	public Page<ProductAttribute> getByProductId(MerchantStore store, Product product, int page, int count)
			throws ServiceException {
		Pageable pageRequest = PageRequest.of(page, count);
		return pageableProductAttributeRepository.findByProductId(store.getId(), product.getId(), pageRequest);

	}

	@Override
	public ProductAttribute saveOrUpdate(ProductAttribute productAttribute) throws ServiceException {
		productAttribute = productAttributeRepository.save(productAttribute);
		return productAttribute;

	}

	@Override
	public void delete(ProductAttribute attribute) throws ServiceException {<FILL_FUNCTION_BODY>}

	@Override
	public List<ProductAttribute> getProductAttributesByCategoryLineage(MerchantStore store, String lineage,
			Language language) throws Exception {
		return productAttributeRepository.findOptionsByCategoryLineage(store.getId(), lineage, language.getId());
	}

}


		// override method, this allows the error that we try to remove a detached
		// variant
		attribute = this.getById(attribute.getId());
		super.delete(attribute);

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