throw new IllegalArgumentException("ProducerInfo '" + producerInfo.getId()
+ "' hasn't been persisted and thus cannot be updated.");
}
ChromatticSession session = persister.getSession();
ProducerInfoMapping pim = session.findById(ProducerInfoMapping.class, key);
if (pim == null)
{
throw new IllegalArgumentException("Couldn't find ProducerInfoMapping associated with key " + key);
}
String oldId = pim.getId();
String newId = producerInfo.getId();
pim.initFrom(producerInfo);
persister.closeSession(session, true);
// if the consumer's id has changed, return the old one so that state can be updated
return (oldId.equals(newId)) ? null : oldId;