Examples of purgeAll()


Examples of org.hibernate.search.FullTextSession.purgeAll()

    tx = s.beginTransaction();
    assertNumberOfAnimals( s, 1 );
    tx.commit();

    tx = s.beginTransaction();
    s.purgeAll( Object.class );
    tx.commit();

    tx = s.beginTransaction();
    assertNumberOfAnimals( s, 0 );
    tx.commit();
View Full Code Here

Examples of org.hibernate.search.FullTextSession.purgeAll()

    assertNumberOfAnimals( s, 5 );
    tx.commit();

    tx = s.beginTransaction();
    try {
      s.purgeAll( String.class );
      tx.commit();
      fail();
    }
    catch ( IllegalArgumentException iae ) {
      log.debug( "Success" );
View Full Code Here

Examples of org.hibernate.search.FullTextSession.purgeAll()

    FullTextSession s = Search.getFullTextSession( openSession() );
    Transaction tx;
    tx = s.beginTransaction();
    for ( Class clazz : getMappings() ) {
      if ( clazz.getAnnotation( Indexed.class ) != null ) {
        s.purgeAll( clazz );
      }
    }
    tx.commit();
    s.close();
  }
View Full Code Here

Examples of org.hibernate.search.FullTextSession.purgeAll()

    s.clear();

    tx = s.beginTransaction();
    QueryParser parser = new QueryParser( "brand", new StopAnalyzer() );
                         tx = s.beginTransaction();
    s.purgeAll( Clock.class);

    tx.commit();

    tx = s.beginTransaction();
View Full Code Here

Examples of org.hibernate.search.FullTextSession.purgeAll()

    }

    private void purge() {
      em.getTransaction().begin();
        FullTextSession ftSession = org.hibernate.search.Search.getFullTextSession((Session) em.getDelegate());
        ftSession.purgeAll(Book.class);
        em.getTransaction().commit();
    }

    private List<Book> search(String searchQuery) throws ParseException {
      Query query = searchQuery(searchQuery);
View Full Code Here

Examples of org.hibernate.search.FullTextSession.purgeAll()

    FullTextSession s = Search.getFullTextSession( openSession() );
    Transaction tx;
    tx = s.beginTransaction();
    for ( Class<?> clazz : getAnnotatedClasses() ) {
      if ( clazz.getAnnotation( Indexed.class ) != null ) {
        s.purgeAll( clazz );
      }
    }
    tx.commit();
    s.close();
  }
View Full Code Here

Examples of org.hibernate.search.FullTextSession.purgeAll()

    }
  }

  private void purge() {
    FullTextSession ftSession = org.hibernate.search.Search.getFullTextSession( (Session) em.getDelegate() );
    ftSession.purgeAll( Book.class );
    ftSession.flushToIndexes();
    ftSession.close();
    emf.close();
  }
View Full Code Here

Examples of org.hibernate.search.FullTextSession.purgeAll()

    FullTextSession fullTextSession = Search.getFullTextSession( openSession() );
    Transaction tx = fullTextSession.beginTransaction();

    // purge all clocks
    fullTextSession.purgeAll( Clock.class );

    tx.commit();
    fullTextSession.close();

    assertNumberOfIndexedEntitiesForTypes( 0, Clock.class );
View Full Code Here

Examples of org.hibernate.search.FullTextSession.purgeAll()

    fullTextSession = Search.getFullTextSession( openSession() );
    tx = fullTextSession.beginTransaction();

    // now purge all books
    fullTextSession.purgeAll( Book.class );

    tx.commit();
    fullTextSession.close();

    assertNumberOfIndexedEntitiesForTypes( 0, Clock.class );
View Full Code Here

Examples of org.hibernate.search.FullTextSession.purgeAll()

    FullTextSession fullTextSession = Search.getFullTextSession( openSession() );
    Transaction tx = fullTextSession.beginTransaction();

    // purge all leaves
    fullTextSession.purgeAll( Leaf.class );

    tx.commit();
    fullTextSession.close();

    assertNumberOfIndexedEntitiesForTypes( 1, Tree.class );
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.