Class HibernateSearchEventListener
- java.lang.Object
-
- org.hibernate.search.mapper.orm.event.impl.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
-
-
Constructor Summary
Constructors Constructor Description HibernateSearchEventListener(HibernateOrmListenerContextProvider contextProvider, boolean dirtyCheckingEnabled)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidonAutoFlush(org.hibernate.event.spi.AutoFlushEvent event)voidonClear(org.hibernate.event.spi.ClearEvent event)voidonFlush(org.hibernate.event.spi.FlushEvent event)Make sure the indexes are updated right after the hibernate flush, avoiding entity loading during a flush.voidonPostDelete(org.hibernate.event.spi.PostDeleteEvent event)voidonPostInsert(org.hibernate.event.spi.PostInsertEvent event)voidonPostRecreateCollection(org.hibernate.event.spi.PostCollectionRecreateEvent event)voidonPostRemoveCollection(org.hibernate.event.spi.PostCollectionRemoveEvent event)voidonPostUpdate(org.hibernate.event.spi.PostUpdateEvent event)voidonPostUpdateCollection(org.hibernate.event.spi.PostCollectionUpdateEvent event)voidregisterTo(org.hibernate.engine.spi.SessionFactoryImplementor sessionFactory)booleanrequiresPostCommitHandling(org.hibernate.persister.entity.EntityPersister persister)Required since Hibernate ORM 4.3
-
-
-
Constructor Detail
-
HibernateSearchEventListener
public HibernateSearchEventListener(HibernateOrmListenerContextProvider contextProvider, boolean dirtyCheckingEnabled)
-
-
Method Detail
-
registerTo
public void registerTo(org.hibernate.engine.spi.SessionFactoryImplementor sessionFactory)
-
onPostDelete
public void onPostDelete(org.hibernate.event.spi.PostDeleteEvent event)
- Specified by:
onPostDeletein interfaceorg.hibernate.event.spi.PostDeleteEventListener
-
onPostInsert
public void onPostInsert(org.hibernate.event.spi.PostInsertEvent event)
- Specified by:
onPostInsertin interfaceorg.hibernate.event.spi.PostInsertEventListener
-
onPostUpdate
public void onPostUpdate(org.hibernate.event.spi.PostUpdateEvent event)
- Specified by:
onPostUpdatein interfaceorg.hibernate.event.spi.PostUpdateEventListener
-
onPostRecreateCollection
public void onPostRecreateCollection(org.hibernate.event.spi.PostCollectionRecreateEvent event)
- Specified by:
onPostRecreateCollectionin interfaceorg.hibernate.event.spi.PostCollectionRecreateEventListener
-
onPostRemoveCollection
public void onPostRemoveCollection(org.hibernate.event.spi.PostCollectionRemoveEvent event)
- Specified by:
onPostRemoveCollectionin interfaceorg.hibernate.event.spi.PostCollectionRemoveEventListener
-
onPostUpdateCollection
public void onPostUpdateCollection(org.hibernate.event.spi.PostCollectionUpdateEvent event)
- Specified by:
onPostUpdateCollectionin interfaceorg.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:
onFlushin interfaceorg.hibernate.event.spi.FlushEventListener
-
onAutoFlush
public void onAutoFlush(org.hibernate.event.spi.AutoFlushEvent event) throws org.hibernate.HibernateException- Specified by:
onAutoFlushin interfaceorg.hibernate.event.spi.AutoFlushEventListener- Throws:
org.hibernate.HibernateException
-
onClear
public void onClear(org.hibernate.event.spi.ClearEvent event)
- Specified by:
onClearin interfaceorg.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
-
-