Package org.hibernate.event.service.spi

Examples of org.hibernate.event.service.spi.EventListenerRegistry.appendListeners()


      );
      listenerRegistry.appendListeners(
          EventType.POST_COLLECTION_RECREATE,
          new EnversPostCollectionRecreateEventListenerImpl( enversConfiguration )
      );
      listenerRegistry.appendListeners(
          EventType.PRE_COLLECTION_REMOVE,
          new EnversPreCollectionRemoveEventListenerImpl( enversConfiguration )
      );
      listenerRegistry.appendListeners(
          EventType.PRE_COLLECTION_UPDATE,
View Full Code Here


      );
      listenerRegistry.appendListeners(
          EventType.PRE_COLLECTION_REMOVE,
          new EnversPreCollectionRemoveEventListenerImpl( enversConfiguration )
      );
      listenerRegistry.appendListeners(
          EventType.PRE_COLLECTION_UPDATE,
          new EnversPreCollectionUpdateEventListenerImpl( enversConfiguration )
      );
    }
  }
View Full Code Here

        super.integrate(configuration, sessionFactory, serviceRegistry);
        EventListenerRegistry listenerRegistry = serviceRegistry.getService( EventListenerRegistry.class );
        listenerRegistry.addDuplicationStrategy( EnversListenerDuplicationStrategy.INSTANCE );
        final AuditConfiguration enversConfiguration = AuditConfiguration.getFor( configuration, serviceRegistry.getService( ClassLoaderService.class ) );
        if (enversConfiguration.getEntCfg().hasAuditedEntities()) {
            listenerRegistry.appendListeners( EventType.POST_DELETE, new EnversOnlyPostDeleteEventListenerImpl( enversConfiguration ) );
        }
    }

    public static class  EnversOnlyPostDeleteEventListenerImpl extends EnversPostDeleteEventListenerImpl {
        public EnversOnlyPostDeleteEventListenerImpl(AuditConfiguration enversConfiguration) {
View Full Code Here

    eventListenerRegistry.addDuplicationStrategy(
        new HibernateSearchIntegrator.DuplicationStrategyImpl(
            FullTextIndexEventListener.class
        )
    );
    eventListenerRegistry.appendListeners( EventType.POST_INSERT, new FullTextIndexEventListener() );

    assertTrue(
        "We should only be one listener, but we have " + eventEventListenerGroup.count(),
        eventEventListenerGroup.count() == 1
    );
View Full Code Here

    if ( !sessionFactory.getSettings().isSecondLevelCacheEnabled() ) {
      // Nothing to do, if caching is disabled
      return;
    }
    EventListenerRegistry eventListenerRegistry = serviceRegistry.getService( EventListenerRegistry.class );
    eventListenerRegistry.appendListeners( EventType.POST_INSERT, this );
    eventListenerRegistry.appendListeners( EventType.POST_DELETE, this );
    eventListenerRegistry.appendListeners( EventType.POST_UPDATE, this );
  }

  private void evictCache(Object entity, EntityPersister persister, EventSource session, Object[] oldState) {
View Full Code Here

      // Nothing to do, if caching is disabled
      return;
    }
    EventListenerRegistry eventListenerRegistry = serviceRegistry.getService( EventListenerRegistry.class );
    eventListenerRegistry.appendListeners( EventType.POST_INSERT, this );
    eventListenerRegistry.appendListeners( EventType.POST_DELETE, this );
    eventListenerRegistry.appendListeners( EventType.POST_UPDATE, this );
  }

  private void evictCache(Object entity, EntityPersister persister, EventSource session, Object[] oldState) {
    try {
View Full Code Here

      return;
    }
    EventListenerRegistry eventListenerRegistry = serviceRegistry.getService( EventListenerRegistry.class );
    eventListenerRegistry.appendListeners( EventType.POST_INSERT, this );
    eventListenerRegistry.appendListeners( EventType.POST_DELETE, this );
    eventListenerRegistry.appendListeners( EventType.POST_UPDATE, this );
  }

  private void evictCache(Object entity, EntityPersister persister, EventSource session, Object[] oldState) {
    try {
      SessionFactoryImplementor factory = persister.getFactory();
View Full Code Here

                            TranslationUpdateListener.class);
            log.info("register event listener: {}", updateListener);
            // We have to use POST_UPDATE not POST_UPDATE_COMMIT. Because we
            // still need to access some other entities to make transunit. After
            // commit the transaction is closed.
            eventListenerRegistry.appendListeners(EventType.POST_UPDATE,
                    updateListener);
            eventListenerRegistry.appendListeners(EventType.POST_INSERT,
                    updateListener);
        }
    }
View Full Code Here

            // We have to use POST_UPDATE not POST_UPDATE_COMMIT. Because we
            // still need to access some other entities to make transunit. After
            // commit the transaction is closed.
            eventListenerRegistry.appendListeners(EventType.POST_UPDATE,
                    updateListener);
            eventListenerRegistry.appendListeners(EventType.POST_INSERT,
                    updateListener);
        }
    }

    @Override
View Full Code Here

            ClassLoaderService.class
        )
    );

    if ( enversConfiguration.getEntCfg().hasAuditedEntities() ) {
      listenerRegistry.appendListeners(
          EventType.POST_DELETE, new EnversPostDeleteEventListenerImpl(
          enversConfiguration
      )
      );
      listenerRegistry.appendListeners(
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.