throw new NotExistingEntityException("Category with ID " + productDTO.getCategory().getId() + " does not exist.");
}
}
Product product = new Product(productDTO.getName(), productDTO.getDescription(), category, eshop, productDTO.getUrl(), productDTO.getPrice(), productDTO.getPriceWithVAT(), productDTO.getImageURL());
eshop.addProduct(product);
eshopDAO.persist(eshop);
return new ProductDTO(product, uriInfo);
}