Package org.hibernate.search.indexes.interceptor

Examples of org.hibernate.search.indexes.interceptor.EntityIndexingInterceptor


    EntityIndexBinder entityIndexBinding = entityIndexBinders.get( clazz );
    // it might be possible to receive not-indexes subclasses of the currently indexed type;
    // being not-indexed, we skip them.
    // FIXME for improved performance: avoid loading them in an early phase.
    if ( entityIndexBinding != null ) {
      EntityIndexingInterceptor interceptor = entityIndexBinding.getEntityIndexingInterceptor();
      if ( isNotSkippable( interceptor, entity ) ) {
        Serializable id = session.getIdentifier( entity );
        AddLuceneWork addWork = createAddLuceneWork( entity, sessionInitializer, conversionContext, id, clazz,
            entityIndexBinding );
        backend.enqueueAsyncWork( addWork );
View Full Code Here


    EntityIndexBinder entityIndexBinding = entityIndexBinders.get( clazz );
    // it might be possible to receive not-indexes subclasses of the currently indexed type;
    // being not-indexed, we skip them.
    // FIXME for improved performance: avoid loading them in an early phase.
    if ( entityIndexBinding != null ) {
      EntityIndexingInterceptor interceptor = entityIndexBinding.getEntityIndexingInterceptor();
      if ( isNotSkippable( interceptor, entity ) ) {
        Serializable id = session.getIdentifier( entity );
        AddLuceneWork addWork = createAddLuceneWork( entity, sessionInitializer, conversionContext, id, clazz,
            entityIndexBinding );
        backend.enqueueAsyncWork( addWork );
View Full Code Here

      // being not-indexed, we skip them.
      // FIXME for improved performance: avoid loading them in an early phase.
      return;
    }

    EntityIndexingInterceptor interceptor = entityIndexBinding.getEntityIndexingInterceptor();
    if ( interceptor != null ) {
      IndexingOverride onAdd = interceptor.onAdd( entity );
      switch ( onAdd ) {
        case REMOVE:
        case SKIP:
          return;
      }
View Full Code Here

      // being not-indexed, we skip them.
      // FIXME for improved performance: avoid loading them in an early phase.
      return;
    }

    EntityIndexingInterceptor interceptor = entityIndexBinding.getEntityIndexingInterceptor();
    if ( interceptor != null ) {
      IndexingOverride onAdd = interceptor.onAdd( entity );
      switch ( onAdd ) {
        case REMOVE:
        case SKIP:
          return;
      }
View Full Code Here

      // being not-indexed, we skip them.
      // FIXME for improved performance: avoid loading them in an early phase.
      return;
    }

    EntityIndexingInterceptor interceptor = entityIndexBinding.getEntityIndexingInterceptor();
    if ( interceptor != null ) {
      IndexingOverride onAdd = interceptor.onAdd( entity );
      switch ( onAdd ) {
        case REMOVE:
        case SKIP:
          return;
      }
View Full Code Here

      shardIdentifierProvider = createShardIdentifierProvider(
          buildContext, indexProperties[0]
      );
    }

    EntityIndexingInterceptor interceptor = createEntityIndexingInterceptor( entity );

    return EntityIndexBindingFactory.buildEntityIndexBinding(
        entity.getClass(),
        indexManagers,
        shardingStrategy,
View Full Code Here

    return shardIdentifierProvider;
  }

  private EntityIndexingInterceptor createEntityIndexingInterceptor(XClass entity) {
    Indexed indexedAnnotation = entity.getAnnotation( Indexed.class );
    EntityIndexingInterceptor interceptor = null;
    if ( indexedAnnotation != null ) {
      Class<? extends EntityIndexingInterceptor> interceptorClass = getInterceptorClassFromHierarchy(
          entity,
          indexedAnnotation
      );
View Full Code Here

  private Work interceptWork(EntityIndexBinding indexBindingForEntity, Work work) {
    if ( indexBindingForEntity == null ) {
      return work;
    }
    EntityIndexingInterceptor interceptor = indexBindingForEntity.getEntityIndexingInterceptor();
    if ( interceptor == null ) {
      return work;
    }
    IndexingOverride operation;
    switch ( work.getType() ) {
      case ADD:
        operation = interceptor.onAdd( work.getEntity() );
        break;
      case UPDATE:
        operation = interceptor.onUpdate( work.getEntity() );
        break;
      case DELETE:
        operation = interceptor.onDelete( work.getEntity() );
        break;
      case COLLECTION:
        operation = interceptor.onCollectionUpdate( work.getEntity() );
        break;
      case PURGE:
      case PURGE_ALL:
      case INDEX:
        operation = IndexingOverride.APPLY_DEFAULT;
View Full Code Here

      WorkerBuildContext context,
      IndexManagerHolder indexManagerHolder) {
    if ( !isDynamicSharding && providers.length == 0 ) {
      throw log.entityWithNoShard( type );
    }
    EntityIndexingInterceptor safeInterceptor = interceptor;
    if ( isDynamicSharding ) {
      return new DynamicShardingEntityIndexBinding( shardIdentifierProvider,
          similarity,
          safeInterceptor,
          properties,
View Full Code Here

      else {
        Serializable extractedId = documentBuilder.getId( value );
        if ( extractedId != null ) {
          PerEntityWork entityWork = entityById.get( extractedId );
          if ( entityWork == null ) {
            EntityIndexingInterceptor entityInterceptor = getEntityInterceptor();
            IndexingOverride operation;
            if ( entityInterceptor != null ) {
              operation = entityInterceptor.onUpdate( value );
            }
            else {
              operation = IndexingOverride.APPLY_DEFAULT;
            }
            //TODO there is a small duplication with some of TransactionalWorker.interceptWork
View Full Code Here

TOP

Related Classes of org.hibernate.search.indexes.interceptor.EntityIndexingInterceptor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.