Package org.hibernate.search.jpa

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


  public void testHibernateSearchJPAAPIUsage() throws Exception {
    getTransactionManager().begin();
    final FullTextEntityManager ftem = Search.getFullTextEntityManager( getFactory().createEntityManager() );
    final Insurance insurance = new Insurance();
    insurance.setName( "Macif" );
    ftem.persist( insurance );
    getTransactionManager().commit();

    ftem.clear();

    getTransactionManager().begin();
View Full Code Here


  public void testQuery() throws Exception {
    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" );
View Full Code Here

  public void testIndex() throws Exception {
    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
View Full Code Here

  public void testIndex() throws Exception {
    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
View Full Code Here

  public void testQuery() throws Exception {
    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" );
View Full Code Here

  public void testIndex() throws Exception {
    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
View Full Code Here

  public void testQuery() throws Exception {
    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" );
View Full Code Here

  public void testQueryTimeoutException() throws Exception {
    FullTextEntityManager em = Search.getFullTextEntityManager( factory.createEntityManager() );
    em.getTransaction().begin();
    for ( long i = 0; i < 1000; i++ ) {
      Clock clock = new Clock( Long.valueOf( i ), "Model cat A" + i, ( i % 2 == 0 ) ? "Seiko" : "Swatch", Long.valueOf( 2000 + i ) );
      em.persist( clock );
    }
    em.getTransaction().commit();

    em.clear();
View Full Code Here

  public void testLimitFetchingTime() {
    FullTextEntityManager em = Search.getFullTextEntityManager( factory.createEntityManager() );
    em.getTransaction().begin();
    for ( long i = 0; i < 1000; i++ ) {
      Clock clock = new Clock( Long.valueOf( i ), "Model cat A" + i, ( i % 2 == 0 ) ? "Seiko" : "Swatch", Long.valueOf( 2000 + i ) );
      em.persist( clock );
    }
    em.getTransaction().commit();

    em.clear();
View Full Code Here

  public void testMassIndexer() throws Exception {
    // index a Bretzel
    FullTextEntityManager em = Search.getFullTextEntityManager( factory.createEntityManager() );
    em.getTransaction().begin();
    Bretzel bretzel = new Bretzel( 23, 34 );
    em.persist( bretzel );
    em.getTransaction().commit();
    em.clear();

    // verify against index
    assertEquals( 1, countBretzelsViaIndex( em ) );
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.