Package org.hibernate.search.backend.spi

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


    sf.close();
  }

  private static void doIndexWork(Object entity, Integer id, SearchFactoryIntegrator sfi, TransactionContextForTest tc) {
    Work work = new Work( entity, id, WorkType.INDEX );
    sfi.getWorker().performWork( work, tc );
  }
View Full Code Here


    LogMessage log = new LogMessage();
    log.timestamp = timestamp;
    log.message = message;

    SearchFactoryImplementor searchFactory = sfHolder.getSearchFactory();
    Work work = new Work( log, log.timestamp, WorkType.ADD, false );
    TransactionContextForTest tc = new TransactionContextForTest();
    searchFactory.getWorker().performWork( work, tc );
    tc.end();
  }
View Full Code Here

  private void deleteLog(long timestamp) {
    LogMessage log = new LogMessage();
    log.timestamp = timestamp;

    SearchFactoryImplementor searchFactory = sfHolder.getSearchFactory();
    Work work = new Work( LogMessage.class, log.timestamp, WorkType.DELETE );
    TransactionContextForTest tc = new TransactionContextForTest();
    searchFactory.getWorker().performWork( work, tc );
    tc.end();
  }
View Full Code Here

        .property( "age", "227" )
        .property( "name", "Thorin" )
        .property( "surname", "Oakenshield" )
        .property( "race", "dwarf" );

      Work work = new Work( holder, holder.id, WorkType.ADD, false );
      TransactionContextForTest tc = new TransactionContextForTest();
      searchFactory.getWorker().performWork( work, tc );
      tc.end();
    }
View Full Code Here

  public void testTypeIsSetForField() {
    SearchFactoryImplementor searchFactory = createSearchFactory( Foo.class );

    Foo foo = new Foo( 0l );

    Work work = new Work( foo, foo.getId(), WorkType.ADD, false );
    TransactionContextForTest tc = new TransactionContextForTest();
    searchFactory.getWorker().performWork( work, tc );
    tc.end();
  }
View Full Code Here

  public void testTypeIsSetForGetter() {
    SearchFactoryImplementor searchFactory = createSearchFactory( Bar.class );

    Bar bar = new Bar( 0l );

    Work work = new Work( bar, bar.getId(), WorkType.ADD, false );
    TransactionContextForTest tc = new TransactionContextForTest();
    searchFactory.getWorker().performWork( work, tc );
    tc.end();
  }
View Full Code Here

  public void testTypeIsSetForClass() {
    SearchFactoryImplementor searchFactory = createSearchFactory( Snafu.class );

    Snafu snafu = new Snafu( 0l );

    Work work = new Work( snafu, snafu.getId(), WorkType.ADD, false );
    TransactionContextForTest tc = new TransactionContextForTest();
    searchFactory.getWorker().performWork( work, tc );
    tc.end();
  }
View Full Code Here

    dvd1.title = dvdTitle;
    storeObject( dvd1, id );
  }

  private void storeObject(Object entity, Serializable id) {
    Work work = new Work( entity, id, WorkType.UPDATE, false );
    TransactionContextForTest tc = new TransactionContextForTest();
    searchFactory.getWorker().performWork( work, tc );
    tc.end();
  }
View Full Code Here

    Book book = new Book();
    book.title = "Empty Book";
    book.text = "The question is, does an empty book have 'space' tokens in it?";

    Work work = new Work( book, book.title, WorkType.ADD, false );
    TransactionContextForTest tc = new TransactionContextForTest();
    searchFactory.getWorker().performWork( work, tc );
    tc.end();

    QueryBuilder queryBuilder = searchFactory.buildQueryBuilder().forEntity( Book.class ).get();
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();

    QueryParser parser = new QueryParser(
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.