Package org.hibernate.search.testsupport.setup

Examples of org.hibernate.search.testsupport.setup.TransactionContextForTest.end()


  private void storeObject(Object entity, Serializable id) {
    Work work = new Work( entity, id, WorkType.UPDATE, false );
    TransactionContextForTest tc = new TransactionContextForTest();
    slaveNode.getSearchFactory().getWorker().performWork( work, tc );
    tc.end();
  }

  @Indexed(index = "dvds")
  public static final class Dvd {
    @DocumentId long id;
View Full Code Here


    book.id = id;
    book.title = bookTitle;
    Work work = new Work( book, book.id, WorkType.ADD, false );
    TransactionContextForTest tc = new TransactionContextForTest();
    worker.performWork( work, tc );
    tc.end();
  }

  private static void deleteABook(Integer id, Worker worker) {
    Book book = new Book();
    book.id = id;
View Full Code Here

    Book book = new Book();
    book.id = id;
    Work work = new Work( book, id, WorkType.DELETE, false );
    TransactionContextForTest tc = new TransactionContextForTest();
    worker.performWork( work, tc );
    tc.end();
  }

  private static void verifyMatches(SearchFactoryImplementor searchFactory, int expectedMatches, Query query) {
    List<EntityInfo> queryEntityInfos = searchFactory.createHSQuery()
        .luceneQuery( query )
View Full Code Here

    book.id = id;
    book.title = bookTitle;
    Work work = new Work( book, book.id, WorkType.ADD, false );
    TransactionContextForTest tc = new TransactionContextForTest();
    sfHolder.getSearchFactory().getWorker().performWork( work, tc );
    tc.end();
  }

  @Indexed(index = "books")
  private static class Book {
    @DocumentId long id;
View Full Code Here

    for ( int i = 0; i < numberEntities; i++ ) {
      Quote quote = new Quote( 1, i * 10 );
      Work work = new Work( quote, quote.id, WorkType.ADD, false );
      TransactionContextForTest tc = new TransactionContextForTest();
      sfHolder.getSearchFactory().getWorker().performWork( work, tc );
      tc.end();
    }
  }

  @Indexed
  private static class Quote {
View Full Code Here

      lastDwarf.name = "Thorin Oakenshield";

      Work work = new Work( lastDwarf, lastDwarf.id, WorkType.ADD, false );
      TransactionContextForTest tc = new TransactionContextForTest();
      searchFactory.getWorker().performWork( work, tc );
      tc.end();
    }

    QueryBuilder guestQueryBuilder = searchFactory.buildQueryBuilder()
        .forEntity( Guest.class )
        .get();
View Full Code Here

      balin.name = "Balin";

      Work work = new Work( balin, balin.id, WorkType.ADD, false );
      TransactionContextForTest tc = new TransactionContextForTest();
      searchFactory.getWorker().performWork( work, tc );
      tc.end();
    }

    List<EntityInfo> queryEntityInfosAgain = searchFactory.createHSQuery()
      .luceneQuery( queryAllGuests )
      .targetedEntities( Arrays.asList( new Class<?>[]{ Guest.class } ) )
View Full Code Here

          " or a nasty exception will remind them. Can't we just assume it's always annotated?";
      String isbn = "some entity-external id";
      Work work = new Work( book, isbn, WorkType.ADD, false );
      TransactionContextForTest tc = new TransactionContextForTest();
      sf.getWorker().performWork( work, tc );
      tc.end();

      QueryBuilder queryBuilder = sf.buildQueryBuilder()
          .forEntity( Book.class )
          .get();
View Full Code Here

    TransactionContextForTest tc = new TransactionContextForTest();

    doIndexWork( new A( 1, "Emmanuel" ), 1, sf, tc );

    tc.end();

    QueryParser parser = new QueryParser(
        TestConstants.getTargetLuceneVersion(),
        "name",
        TestConstants.standardAnalyzer
View Full Code Here

    tc = new TransactionContextForTest();

    doIndexWork( new B( 1, "Noel" ), 1, sf, tc );

    tc.end();

    luceneQuery = parser.parse( "Noel" );

    indexReader = sf.getIndexReaderAccessor().open( B.class );
    searcher = new IndexSearcher( indexReader );
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.