protected void initForMappingContext(MappingContext mappingContext) { for (PersistentEntity persistentEntity : mappingContext.getPersistentEntities()) { storeDateCreatedAndLastUpdatedInfo(persistentEntity); } mappingContext.addMappingContextListener(this); }
protected DomainEventListener(ConnectionSourcesProvider connectionSourcesProvider, final MappingContext mappingContext) { super(null); for (PersistentEntity entity : mappingContext.getPersistentEntities()) { createEventCaches(entity); } autowireEntities = connectionSourcesProvider.getConnectionSources().getDefaultConnectionSource().getSettings().isAutowire(); mappingContext.addMappingContextListener(this); }
public DomainEventListener(final Datastore datastore) { super(datastore); for (PersistentEntity entity : datastore.getMappingContext().getPersistentEntities()) { createEventCaches(entity); } datastore.getMappingContext().addMappingContextListener(this); if(datastore instanceof ConnectionSourcesProvider) { autowireEntities = ((ConnectionSourcesProvider)datastore).getConnectionSources().getDefaultConnectionSource().getSettings().isAutowire(); } else { autowireEntities = false; } }