Class HibernateSearchEventListener

  • All Implemented Interfaces:
    org.hibernate.event.spi.AutoFlushEventListener, org.hibernate.event.spi.ClearEventListener, org.hibernate.event.spi.FlushEventListener, org.hibernate.event.spi.PostCollectionRecreateEventListener, org.hibernate.event.spi.PostCollectionRemoveEventListener, org.hibernate.event.spi.PostCollectionUpdateEventListener, org.hibernate.event.spi.PostDeleteEventListener, org.hibernate.event.spi.PostInsertEventListener, org.hibernate.event.spi.PostUpdateEventListener

    public final class HibernateSearchEventListener
    extends Object
    implements org.hibernate.event.spi.PostDeleteEventListener, org.hibernate.event.spi.PostInsertEventListener, org.hibernate.event.spi.PostUpdateEventListener, org.hibernate.event.spi.PostCollectionRecreateEventListener, org.hibernate.event.spi.PostCollectionRemoveEventListener, org.hibernate.event.spi.PostCollectionUpdateEventListener, org.hibernate.event.spi.FlushEventListener, org.hibernate.event.spi.AutoFlushEventListener, org.hibernate.event.spi.ClearEventListener
    Hibernate ORM event listener called by various ORM life cycle events. This listener must be registered in order to enable automatic index updates.
    Author:
    Gavin King, Emmanuel Bernard, Mattias Arbin, Sanne Grinovero, Hardy Ferentschik
    • Method Detail

      • registerTo

        public void registerTo​(org.hibernate.engine.spi.SessionFactoryImplementor sessionFactory)
      • onPostDelete

        public void onPostDelete​(org.hibernate.event.spi.PostDeleteEvent event)
        Specified by:
        onPostDelete in interface org.hibernate.event.spi.PostDeleteEventListener
      • onPostInsert

        public void onPostInsert​(org.hibernate.event.spi.PostInsertEvent event)
        Specified by:
        onPostInsert in interface org.hibernate.event.spi.PostInsertEventListener
      • onPostUpdate

        public void onPostUpdate​(org.hibernate.event.spi.PostUpdateEvent event)
        Specified by:
        onPostUpdate in interface org.hibernate.event.spi.PostUpdateEventListener
      • onPostRecreateCollection

        public void onPostRecreateCollection​(org.hibernate.event.spi.PostCollectionRecreateEvent event)
        Specified by:
        onPostRecreateCollection in interface org.hibernate.event.spi.PostCollectionRecreateEventListener
      • onPostRemoveCollection

        public void onPostRemoveCollection​(org.hibernate.event.spi.PostCollectionRemoveEvent event)
        Specified by:
        onPostRemoveCollection in interface org.hibernate.event.spi.PostCollectionRemoveEventListener
      • onPostUpdateCollection

        public void onPostUpdateCollection​(org.hibernate.event.spi.PostCollectionUpdateEvent event)
        Specified by:
        onPostUpdateCollection in interface org.hibernate.event.spi.PostCollectionUpdateEventListener
      • onFlush

        public void onFlush​(org.hibernate.event.spi.FlushEvent event)
        Make sure the indexes are updated right after the hibernate flush, avoiding entity loading during a flush. Not needed during transactions.
        Specified by:
        onFlush in interface org.hibernate.event.spi.FlushEventListener
      • onAutoFlush

        public void onAutoFlush​(org.hibernate.event.spi.AutoFlushEvent event)
                         throws org.hibernate.HibernateException
        Specified by:
        onAutoFlush in interface org.hibernate.event.spi.AutoFlushEventListener
        Throws:
        org.hibernate.HibernateException
      • onClear

        public void onClear​(org.hibernate.event.spi.ClearEvent event)
        Specified by:
        onClear in interface org.hibernate.event.spi.ClearEventListener
      • requiresPostCommitHandling

        @SuppressForbiddenApis(reason="We are forced to implement this method and it requires accepting an EntityPersister")
        public boolean requiresPostCommitHandling​(org.hibernate.persister.entity.EntityPersister persister)
        Required since Hibernate ORM 4.3