Package org.hibernate.search

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


    org.hibernate.Query hibQuery = s.createFullTextQuery( query, Clock.class, Book.class );
    List results = hibQuery.list();
    assertEquals("incorrect test record", 1, results.size());
    assertEquals("incorrect test record", 1, ((Clock)results.get( 0 )).getId().intValue());

    s.purge( Clock.class, ((Clock)results.get( 0 )).getId());

    tx.commit();

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


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

    Clock clock = getSingleInstanceOfType( fullTextSession, Clock.class );
    // purge a single clock instance from the index
    fullTextSession.purge( Clock.class, clock.getId() );

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

    assertNumberOfIndexedEntitiesForTypes( 1, Clock.class ); // only a single clock instance got purged
View Full Code Here

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

    Leaf leave = getSingleInstanceOfType( fullTextSession, Leaf.class );
    // purge a single leave
    fullTextSession.purge( Leaf.class, leave.getId() );

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

    assertNumberOfIndexedEntitiesForTypes( 1, Tree.class );
View Full Code Here

    assertNumberOfIndexedEntitiesForTypes( 4, Leaf.class );

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

    fullTextSession.purge( Leaf.class, null );

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

    assertNumberOfIndexedEntitiesForTypes( 1, Tree.class );
View Full Code Here

    org.hibernate.Query hibQuery = s.createFullTextQuery( query, Clock.class, Book.class );
    List results = hibQuery.list();
    assertEquals("incorrect test record", 1, results.size());
    assertEquals("incorrect test record", 1, ((Clock)results.get( 0 )).getId().intValue());

    s.purge( Clock.class, ((Clock)results.get( 0 )).getId());

    tx.commit();

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

    org.hibernate.Query hibQuery = s.createFullTextQuery( query, Clock.class, Book.class );
    List results = hibQuery.list();
    assertEquals("incorrect test record", 1, results.size());
    assertEquals("incorrect test record", 1, ((Clock)results.get( 0 )).getId().intValue());

    s.purge( Clock.class, ((Clock)results.get( 0 )).getId());

    tx.commit();

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

    org.hibernate.Query hibQuery = s.createFullTextQuery( query, Clock.class, Book.class );
    List results = hibQuery.list();
    assertEquals("incorrect test record", 1, results.size());
    assertEquals("incorrect test record", 1, ((Clock)results.get( 0 )).getId().intValue());

    s.purge( Clock.class, ((Clock)results.get( 0 )).getId());

    tx.commit();

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

    ts.setLength( 23.2d );
    s.persist( ts );
    s.getTransaction().commit();
    FullTextSession fullTextSession = Search.getFullTextSession( s );
    fullTextSession.beginTransaction();
    fullTextSession.purge( TShirt.class, 1 );
    fullTextSession.getTransaction().commit();
    s.close();
    return ts;
  }
View Full Code Here

        Class< ? > clazz = inRequest.getClazz();
        List<Long> ids = inRequest.getIds();

        for (Long id : ids)
        {
            session.purge(clazz, id);
        }

        return Boolean.TRUE;
    }
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.