Package org.hibernate.search.jpa

Examples of org.hibernate.search.jpa.FullTextEntityManager.clear()


    final Insurance insurance = new Insurance();
    insurance.setName( "Macif" );
    ftem.persist( insurance );
    getTransactionManager().commit();

    ftem.clear();

    getTransactionManager().begin();
    final QueryBuilder b = ftem.getSearchFactory()
        .buildQueryBuilder()
        .forEntity( Insurance.class )
View Full Code Here


    FullTextEntityManager em = Search.getFullTextEntityManager( factory.createEntityManager() );
    em.getTransaction().begin();
    Bretzel bretzel = new Bretzel( 23, 34 );
    em.persist( bretzel );
    em.getTransaction().commit();
    em.clear();
    em.getTransaction().begin();
    QueryParser parser = new QueryParser( "title", new StopAnalyzer() );
    Query query = parser.parse( "saltQty:noword" );
    assertEquals( 0, em.createFullTextQuery( query ).getResultList().size() );
    query = new TermQuery( new Term("saltQty", "23.0") );
View Full Code Here

    assertEquals( "getSingleResult and object retrieval", 23f,
        ( (Bretzelem.createFullTextQuery( query ).getSingleResult() ).getSaltQty() );
    assertEquals( 1, em.createFullTextQuery( query ).getResultSize() );
    em.getTransaction().commit();

    em.clear();

    em.getTransaction().begin();
    em.remove( em.find( Bretzel.class, bretzel.getId() ) );
    em.getTransaction().commit();
    em.close();
View Full Code Here

    FullTextEntityManager em = Search.getFullTextEntityManager( factory.createEntityManager() );
    em.getTransaction().begin();
    Bretzel bretzel = new Bretzel( 23, 34 );
    em.persist( bretzel );
    em.getTransaction().commit();
    em.clear();

    //Not really a unit test but a test that shows the method call without failing
    //FIXME port the index test
    em.getTransaction().begin();
    em.index( em.find( Bretzel.class, bretzel.getId() ) );
View Full Code Here

    FullTextEntityManager em = Search.createFullTextEntityManager( factory.createEntityManager() );
    em.getTransaction().begin();
    Bretzel bretzel = new Bretzel( 23, 34 );
    em.persist( bretzel );
    em.getTransaction().commit();
    em.clear();

    //Not really a unit test but a test that shows the method call without failing
    //FIXME port the index test
    em.getTransaction().begin();
    em.index( em.find( Bretzel.class, bretzel.getId() ) );
View Full Code Here

    FullTextEntityManager em = Search.createFullTextEntityManager( factory.createEntityManager() );
    em.getTransaction().begin();
    Bretzel bretzel = new Bretzel( 23, 34 );
    em.persist( bretzel );
    em.getTransaction().commit();
    em.clear();
    em.getTransaction().begin();
    QueryParser parser = new QueryParser( "title", new StopAnalyzer() );
    Query query = parser.parse( "saltQty:noword" );
    assertEquals( 0, em.createFullTextQuery( query ).getResultList().size() );
    query = new TermQuery( new Term("saltQty", "23.0") );
View Full Code Here

    assertEquals( "getSingleResult and object retrieval", 23f,
        ( (Bretzelem.createFullTextQuery( query ).getSingleResult() ).getSaltQty() );
    assertEquals( 1, em.createFullTextQuery( query ).getResultSize() );
    em.getTransaction().commit();

    em.clear();

    em.getTransaction().begin();
    em.remove( em.find( Bretzel.class, bretzel.getId() ) );
    em.getTransaction().commit();
    em.close();
View Full Code Here

    FullTextEntityManager em = Search.getFullTextEntityManager( factory.createEntityManager() );
    em.getTransaction().begin();
    Bretzel bretzel = new Bretzel( 23, 34 );
    em.persist( bretzel );
    em.getTransaction().commit();
    em.clear();
    em.getTransaction().begin();
    QueryParser parser = new QueryParser( "title", new StopAnalyzer() );
    Query query = parser.parse( "saltQty:noword" );
    assertEquals( 0, em.createFullTextQuery( query ).getResultList().size() );
    query = new TermQuery( new Term("saltQty", "23.0") );
View Full Code Here

    assertEquals( "getSingleResult and object retrieval", 23f,
        ( (Bretzelem.createFullTextQuery( query ).getSingleResult() ).getSaltQty() );
    assertEquals( 1, em.createFullTextQuery( query ).getResultSize() );
    em.getTransaction().commit();

    em.clear();

    em.getTransaction().begin();
    em.remove( em.find( Bretzel.class, bretzel.getId() ) );
    em.getTransaction().commit();
    em.close();
View Full Code Here

    FullTextEntityManager em = Search.getFullTextEntityManager( factory.createEntityManager() );
    em.getTransaction().begin();
    Bretzel bretzel = new Bretzel( 23, 34 );
    em.persist( bretzel );
    em.getTransaction().commit();
    em.clear();

    //Not really a unit test but a test that shows the method call without failing
    //FIXME port the index test
    em.getTransaction().begin();
    em.index( em.find( Bretzel.class, bretzel.getId() ) );
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.