ChromatticSession session = persister.getSession();
RegistrationSPI registration = null;
try
{
ConsumerMapping cm = session.findById(ConsumerMapping.class, consumer.getPersistentKey());
RegistrationMapping rm = cm.createAndAddRegistrationMappingFrom(null);
registration = newRegistrationSPI(consumer, registrationProperties, rm.getPersistentKey());
rm.initFrom(registration);
persister.closeSession(session, true);
}
catch (Exception e)
{
e.printStackTrace(); // todo fix me