} else {
sessionImpl = (SessionImplementor) session;
}
// todo : I wonder if there is a better means to do this via "named lookup" based on the session factory name/uuid
final EventListenerRegistry listenerRegistry = sessionImpl
.getFactory()
.getServiceRegistry()
.getService( EventListenerRegistry.class );
for ( PostInsertEventListener listener : listenerRegistry.getEventListenerGroup( EventType.POST_INSERT ).listeners() ) {
if ( listener instanceof EnversListener ) {
// todo : slightly different from original code in that I am not checking the other listener groups...
return new AuditReaderImpl(
( (EnversListener) listener ).getAuditConfiguration(),
session,