Package org.hibernate.search.backend.spi

Examples of org.hibernate.search.backend.spi.Work


  public void addSynchronization(EventSource eventSource, Synchronization synchronization) {
    this.flushSynch.put( eventSource, synchronization );
  }

  protected void processWork(Object entity, Serializable id, WorkType workType, AbstractEvent event, boolean identifierRollbackEnabled) {
    Work work = new Work( entity, id, workType, identifierRollbackEnabled );
    final EventSourceTransactionContext transactionContext = new EventSourceTransactionContext( event.getSession() );
    searchFactoryImplementor.getWorker().performWork( work, transactionContext );
  }
View Full Code Here


    person3.setName( "Regular goat" );
    person3.setBlurb( "Is anorexic" );

    TransactionContextForTest tc = new TransactionContextForTest();

    Work work = new Work( person1, 1, WorkType.INDEX );
    sf.getWorker().performWork( work, tc );
    work = new Work( person2, 2, WorkType.INDEX );
    sf.getWorker().performWork( work, tc );
    Work work2 = new Work( person3, 3, WorkType.INDEX );
    sf.getWorker().performWork( work2, tc );

    tc.end();

    Transaction transaction = fullTextSession.beginTransaction();
View Full Code Here

*/
public class DefaultSearchWorkCreator<T> implements SearchWorkCreator<T> {

   @Override
   public Collection<Work> createPerEntityTypeWorks(Class<T> entityType, WorkType workType) {
      Work work = new Work(entityType, null, workType);
      return Collections.singleton(work);
   }
View Full Code Here

      return Collections.singleton(work);
   }

   @Override
   public Collection<Work> createPerEntityWorks(T entity, Serializable id, WorkType workType) {
      Work work = new Work(entity, id, workType);
      return Collections.singleton(work);
   }
View Full Code Here

  public void addSynchronization(EventSource eventSource, Synchronization synchronization) {
    this.flushSynch.put( eventSource, synchronization );
  }

  protected void processWork(Object entity, Serializable id, WorkType workType, AbstractEvent event, boolean identifierRollbackEnabled) {
    Work work = new Work( entity, id, workType, identifierRollbackEnabled );
    final EventSourceTransactionContext transactionContext = new EventSourceTransactionContext( event.getSession() );
    searchFactoryImplementor.getWorker().performWork( work, transactionContext );
  }
View Full Code Here

      }
    }
  }

  private void createAndPerformWork(Class<?> clazz, Serializable id, WorkType workType) {
    Work work = new Work( clazz, id, workType );
    getSearchFactoryImplementor().getWorker().performWork( work, transactionContext );
  }
View Full Code Here

    if ( searchFactoryImplementor.getIndexBinding( clazz ) == null ) {
      String msg = "Entity to index is not an @Indexed entity: " + entity.getClass().getName();
      throw new IllegalArgumentException( msg );
    }
    Serializable id = session.getIdentifier( entity );
    Work work = new Work( entity, id, WorkType.INDEX );
    searchFactoryImplementor.getWorker().performWork( work, transactionContext );

    //TODO
    //need to add elements in a queue kept at the Session level
    //the queue will be processed by a Lucene(Auto)FlushEventListener
View Full Code Here

TOP

Related Classes of org.hibernate.search.backend.spi.Work

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.