Package org.hibernate.search

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


  public void testSubclassInclusion() throws Exception {
    createTestData();

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

    Query query = new TermQuery( new Term( "numberOfEggs", "2" ) );
    org.hibernate.Query hibQuery = s.createFullTextQuery( query, Eagle.class );
    List result = hibQuery.list();
    assertNotNull( result );
View Full Code Here


    s.close();
  }

  public void testCriteria() throws Exception {
    FullTextSession s = Search.getFullTextSession( openSession() );
    Transaction tx = s.beginTransaction();
    Book book = new Book( 1, "La chute de la petite reine a travers les yeux de Festina", "La chute de la petite reine a travers les yeux de Festina, blahblah" );
    s.save( book );
    Author emmanuel = new Author();
    emmanuel.setName( "Emmanuel" );
    s.save( emmanuel );
View Full Code Here

   */
  public void testPurgeIndex() throws Exception {
    createTestData();
    FullTextSession s = Search.getFullTextSession( openSession() );

    Transaction tx = s.beginTransaction();
    assertNumberOfAnimals( s, 5 );
    tx.commit();

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

    Transaction tx = s.beginTransaction();
    assertNumberOfAnimals( s, 5 );
    tx.commit();

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

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

    emmanuel.setName( "Emmanuel" );
    s.save( emmanuel );
    book.getAuthors().add( emmanuel );
    tx.commit();
    s.clear();
    tx = s.beginTransaction();
    QueryParser parser = new QueryParser( "title", new StopAnalyzer() );

    Query query = parser.parse( "summary:Festina" );
    org.hibernate.Query hibQuery = s.createFullTextQuery( query, Book.class );
    List result = hibQuery.list();
View Full Code Here

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    s.close();
  }
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.