public final class FullTextIndexEventListener extends Object implements PostDeleteEventListener, PostInsertEventListener, PostUpdateEventListener, PostCollectionRecreateEventListener, PostCollectionRemoveEventListener, PostCollectionUpdateEventListener, FlushEventListener
Constructor and Description |
---|
FullTextIndexEventListener() |
Modifier and Type | Method and Description |
---|---|
void |
addSynchronization(EventSource eventSource,
Synchronization synchronization)
Adds a synchronization to be performed in the onFlush method;
should only be used as workaround for the case a flush is happening
out of transaction.
|
static boolean |
eventsDisabled(org.hibernate.search.engine.integration.impl.ExtendedSearchIntegrator extendedIntegrator) |
String[] |
getDirtyPropertyNames(PostUpdateEvent event) |
protected org.hibernate.search.engine.spi.AbstractDocumentBuilder |
getDocumentBuilder(Object instance)
It is not suggested to extend FullTextIndexEventListener, but when needed to implement special
use cases implementors might need this method.
|
org.hibernate.search.engine.integration.impl.ExtendedSearchIntegrator |
getExtendedSearchFactoryIntegrator() |
void |
initialize(CompletableFuture<org.hibernate.search.engine.integration.impl.ExtendedSearchIntegrator> extendedIntegratorFuture)
Initialize method called by Hibernate Core when the SessionFactory starts.
|
void |
onFlush(FlushEvent event)
Make sure the indexes are updated right after the hibernate flush,
avoiding object loading during a flush.
|
void |
onPostDelete(PostDeleteEvent event) |
void |
onPostInsert(PostInsertEvent event) |
void |
onPostRecreateCollection(PostCollectionRecreateEvent event) |
void |
onPostRemoveCollection(PostCollectionRemoveEvent event) |
void |
onPostUpdate(PostUpdateEvent event) |
void |
onPostUpdateCollection(PostCollectionUpdateEvent event) |
protected void |
processCollectionEvent(AbstractCollectionEvent event) |
protected void |
processWork(String tenantIdentifier,
Object entity,
Serializable id,
org.hibernate.search.backend.spi.WorkType workType,
AbstractEvent event,
boolean identifierRollbackEnabled) |
boolean |
requiresPostCommitHanding(EntityPersister persister)
Required since Hibernate ORM 4.3
|
default boolean |
requiresPostCommitHandling(EntityPersister persister)
Does this listener require that after transaction hooks be registered?
|
static boolean |
skipDirtyChecks(org.hibernate.search.engine.integration.impl.ExtendedSearchIntegrator extendedIntegrator) |
public void onPostDelete(PostDeleteEvent event)
onPostDelete
in interface PostDeleteEventListener
public void onPostInsert(PostInsertEvent event)
onPostInsert
in interface PostInsertEventListener
public void onPostUpdate(PostUpdateEvent event)
onPostUpdate
in interface PostUpdateEventListener
public void onPostRecreateCollection(PostCollectionRecreateEvent event)
onPostRecreateCollection
in interface PostCollectionRecreateEventListener
public void onPostRemoveCollection(PostCollectionRemoveEvent event)
onPostRemoveCollection
in interface PostCollectionRemoveEventListener
public void onPostUpdateCollection(PostCollectionUpdateEvent event)
onPostUpdateCollection
in interface PostCollectionUpdateEventListener
public void onFlush(FlushEvent event)
onFlush
in interface FlushEventListener
event
- The flush event to be handled.public org.hibernate.search.engine.integration.impl.ExtendedSearchIntegrator getExtendedSearchFactoryIntegrator()
public String[] getDirtyPropertyNames(PostUpdateEvent event)
public void initialize(CompletableFuture<org.hibernate.search.engine.integration.impl.ExtendedSearchIntegrator> extendedIntegratorFuture)
extendedIntegratorFuture
- a completable future that will eventually hold the ExtendedSearchIntegrator
public void addSynchronization(EventSource eventSource, Synchronization synchronization)
eventSource
- should be the Session doing the flushsynchronization
- the synchronisation instanceprotected void processWork(String tenantIdentifier, Object entity, Serializable id, org.hibernate.search.backend.spi.WorkType workType, AbstractEvent event, boolean identifierRollbackEnabled)
protected void processCollectionEvent(AbstractCollectionEvent event)
protected org.hibernate.search.engine.spi.AbstractDocumentBuilder getDocumentBuilder(Object instance)
instance
- the object instance for which to retrieve the document builderDocumentBuilder
for the specified objectpublic boolean requiresPostCommitHanding(EntityPersister persister)
persister
- The persister for the entity in question.true
if after transaction callbacks should be added.public static boolean skipDirtyChecks(org.hibernate.search.engine.integration.impl.ExtendedSearchIntegrator extendedIntegrator)
public static boolean eventsDisabled(org.hibernate.search.engine.integration.impl.ExtendedSearchIntegrator extendedIntegrator)
public boolean requiresPostCommitHandling(EntityPersister persister)
persister
- The persister for the entity in question.true
if after transaction callbacks should be added.Copyright © 2021 JBoss by Red Hat. All rights reserved.