Class HibernateSearchEventListener
java.lang.Object
org.hibernate.search.mapper.orm.event.impl.HibernateSearchEventListener
- All Implemented Interfaces:
AutoFlushEventListener,ClearEventListener,FlushEventListener,PostCollectionRecreateEventListener,PostCollectionRemoveEventListener,PostCollectionUpdateEventListener,PostDeleteEventListener,PostInsertEventListener,PostUpdateEventListener
public final class HibernateSearchEventListener
extends Object
implements PostDeleteEventListener, PostInsertEventListener, PostUpdateEventListener, PostCollectionRecreateEventListener, PostCollectionRemoveEventListener, PostCollectionUpdateEventListener, FlushEventListener, AutoFlushEventListener, 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
ConstructorsConstructorDescriptionHibernateSearchEventListener(HibernateOrmListenerContextProvider contextProvider, boolean dirtyCheckingEnabled) -
Method Summary
Modifier and TypeMethodDescriptionvoidonAutoFlush(AutoFlushEvent event) Handle the given auto-flush event.voidonClear(ClearEvent event) Callback forSession.clear()notificationvoidonFlush(FlushEvent event) Make sure the indexes are updated right after the hibernate flush, avoiding entity loading during a flush.voidonPostDelete(PostDeleteEvent event) voidonPostInsert(PostInsertEvent event) voidvoidvoidonPostUpdate(PostUpdateEvent event) voidvoidregisterTo(SessionFactoryImplementor sessionFactory) booleanrequiresPostCommitHandling(EntityPersister persister) Required since Hibernate ORM 4.3Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.hibernate.event.spi.AutoFlushEventListener
onAutoPreFlush
-
Constructor Details
-
HibernateSearchEventListener
public HibernateSearchEventListener(HibernateOrmListenerContextProvider contextProvider, boolean dirtyCheckingEnabled)
-
-
Method Details
-
registerTo
-
onPostDelete
- Specified by:
onPostDeletein interfacePostDeleteEventListener
-
onPostInsert
- Specified by:
onPostInsertin interfacePostInsertEventListener
-
onPostUpdate
- Specified by:
onPostUpdatein interfacePostUpdateEventListener
-
onPostRecreateCollection
- Specified by:
onPostRecreateCollectionin interfacePostCollectionRecreateEventListener
-
onPostRemoveCollection
- Specified by:
onPostRemoveCollectionin interfacePostCollectionRemoveEventListener
-
onPostUpdateCollection
- Specified by:
onPostUpdateCollectionin interfacePostCollectionUpdateEventListener
-
onFlush
Make sure the indexes are updated right after the hibernate flush, avoiding entity loading during a flush. Not needed during transactions.- Specified by:
onFlushin interfaceFlushEventListener- Parameters:
event- The flush event to be handled.
-
onAutoFlush
Description copied from interface:AutoFlushEventListenerHandle the given auto-flush event.- Specified by:
onAutoFlushin interfaceAutoFlushEventListener- Parameters:
event- The auto-flush event to be handled.- Throws:
HibernateException
-
onClear
Description copied from interface:ClearEventListenerCallback forSession.clear()notification- Specified by:
onClearin interfaceClearEventListener- Parameters:
event- The event representing the clear
-
requiresPostCommitHandling
@SuppressForbiddenApis(reason="We are forced to implement this method and it requires accepting an EntityPersister") public boolean requiresPostCommitHandling(EntityPersister persister) Required since Hibernate ORM 4.3
-