class TaxClassServiceImpl extends SalesManagerEntityServiceImpl<Long, TaxClass>
		implements TaxClassService {

	private TaxClassRepository taxClassRepository;
	
	@Inject
	public TaxClassServiceImpl(TaxClassRepository taxClassRepository) {
		super(taxClassRepository);
		
		this.taxClassRepository = taxClassRepository;
	}
	
	@Override
	public List<TaxClass> listByStore(MerchantStore store) throws ServiceException {	
		return taxClassRepository.findByStore(store.getId());
	}
	
	@Override
	public TaxClass getByCode(String code) throws ServiceException {
		return taxClassRepository.findByCode(code);
	}
	
	@Override
	public TaxClass getByCode(String code, MerchantStore store) throws ServiceException {
		return taxClassRepository.findByStoreAndCode(store.getId(), code);
	}
	
	@Override
	public void delete(TaxClass taxClass) throws ServiceException {
		
		TaxClass t = getById(taxClass.getId());
		super.delete(t);
		
	}
	
	@Override
	public TaxClass getById(Long id) {
		return taxClassRepository.getOne(id);
	}

	@Override
	public boolean exists(String code, MerchantStore store) throws ServiceException {
		Validate.notNull(code, "TaxClass code cannot be empty");
		Validate.notNull(store, "MerchantStore cannot be null");
		
		return taxClassRepository.findByStoreAndCode(store.getId(), code) != null;

	}
	
	@Override
	public TaxClass saveOrUpdate(TaxClass taxClass) throws ServiceException {<FILL_FUNCTION_BODY>}

	

}

		if(taxClass.getId()!=null && taxClass.getId() > 0) {
			this.update(taxClass);
		} else {
			taxClass = super.saveAndFlush(taxClass);
		}
		return taxClass;
	
<methods>public void <init>(JpaRepository<com.salesmanager.core.model.tax.taxclass.TaxClass,java.lang.Long>) ,public java.lang.Long count() ,public void create(com.salesmanager.core.model.tax.taxclass.TaxClass) throws com.salesmanager.core.business.exception.ServiceException,public void delete(com.salesmanager.core.model.tax.taxclass.TaxClass) throws com.salesmanager.core.business.exception.ServiceException,public void flush() ,public com.salesmanager.core.model.tax.taxclass.TaxClass getById(java.lang.Long) ,public List<com.salesmanager.core.model.tax.taxclass.TaxClass> list() ,public void save(com.salesmanager.core.model.tax.taxclass.TaxClass) throws com.salesmanager.core.business.exception.ServiceException,public void saveAll(Iterable<com.salesmanager.core.model.tax.taxclass.TaxClass>) throws com.salesmanager.core.business.exception.ServiceException,public void update(com.salesmanager.core.model.tax.taxclass.TaxClass) throws com.salesmanager.core.business.exception.ServiceException<variables>private Class<com.salesmanager.core.model.tax.taxclass.TaxClass> objectClass,private JpaRepository<com.salesmanager.core.model.tax.taxclass.TaxClass,java.lang.Long> repository