log.log(Level.WARNING, "User "+userId+" is trying to update an offer of "+offer.getUserId());
return null;
}
Set<ProductOffered> offers = new HashSet<ProductOffered>();
for(Entry<String,String> entry : productIdNames.entrySet()){
ProductOffered productOffered = new ProductOffered();
productOffered.setOffer(offer);
productOffered.setProductId(entry.getKey());
productOffered.setProductName(entry.getValue());
offers.add(productOffered);
model.persist(productOffered);
}
offer.setProductOffered(offers);
result = new UpdateOfferResult(new OffersPerProduct(offerId, KeyFactory.keyToString(offer.getProduct().getKey()), offer.getProduct().getName(), productIdNames));