org.hibernate.search.indexes.interceptor
Class DefaultEntityInterceptor

java.lang.Object
  extended by org.hibernate.search.indexes.interceptor.DefaultEntityInterceptor
All Implemented Interfaces:
EntityIndexingInterceptor<Object>

public class DefaultEntityInterceptor
extends Object
implements EntityIndexingInterceptor<Object>

Default interceptor logic: If the hierarchy does not define a specific interceptor, then no interception logic is applied If the hierarchy defines a specific interceptor, then we inherit the explicit interceptor defined by the most specific superclass and use it.

Author:
Emmanuel Bernard

Constructor Summary
DefaultEntityInterceptor()
           
 
Method Summary
 IndexingOverride onAdd(Object entity)
          Triggered when an entity instance T should be added to the index, either by an event listener or by the MassIndexer.
 IndexingOverride onCollectionUpdate(Object entity)
          A CollectionUpdate event is fired on collections included in an indexed entity, for example when using IndexedEmbedded This event is triggered on each indexed domain instance T contained in such a collection; this is generally similar to a EntityIndexingInterceptor.onUpdate(Object) event.
 IndexingOverride onDelete(Object entity)
          Triggered when an entity instance T should be deleted from the index.
 IndexingOverride onUpdate(Object entity)
          Triggered when an entity instance T should be updated in the index.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultEntityInterceptor

public DefaultEntityInterceptor()
Method Detail

onAdd

public IndexingOverride onAdd(Object entity)
Description copied from interface: EntityIndexingInterceptor
Triggered when an entity instance T should be added to the index, either by an event listener or by the MassIndexer. This is not triggered by an explicit API call such as FullTextSession.index(T).

Specified by:
onAdd in interface EntityIndexingInterceptor<Object>
Parameters:
entity - The entity instance
Returns:
Return IndexingOverride.APPLY_DEFAULT to have the instance be added to the index as normal; return a different value to override the behaviour.

onUpdate

public IndexingOverride onUpdate(Object entity)
Description copied from interface: EntityIndexingInterceptor
Triggered when an entity instance T should be updated in the index.

Specified by:
onUpdate in interface EntityIndexingInterceptor<Object>
Parameters:
entity - The entity instance
Returns:
Return IndexingOverride.APPLY_DEFAULT to have the instance removed and re-added to the index as normal; return a different value to override the behaviour.

onDelete

public IndexingOverride onDelete(Object entity)
Description copied from interface: EntityIndexingInterceptor
Triggered when an entity instance T should be deleted from the index.

Specified by:
onDelete in interface EntityIndexingInterceptor<Object>
Parameters:
entity - The entity instance
Returns:
Return IndexingOverride.APPLY_DEFAULT to have the instance removed from the index as normal; return a different value to override the behaviour.

onCollectionUpdate

public IndexingOverride onCollectionUpdate(Object entity)
Description copied from interface: EntityIndexingInterceptor
A CollectionUpdate event is fired on collections included in an indexed entity, for example when using IndexedEmbedded This event is triggered on each indexed domain instance T contained in such a collection; this is generally similar to a EntityIndexingInterceptor.onUpdate(Object) event.

Specified by:
onCollectionUpdate in interface EntityIndexingInterceptor<Object>
Parameters:
entity - The entity instance
Returns:
Return IndexingOverride.APPLY_DEFAULT to have the instance removed and re-added to the index as normal; return a different value to override the behaviour.


Copyright © 2006-2013 Red Hat Middleware, LLC. All Rights Reserved